1, 下载安装JDK的docker container

我是从这个源下载已经做好的JDK8的container:

https://registry.hub.docker.com/u/dockerfile/java/

docker run -it --rm dockerfile/java:oracle-java8

2, 添加GUI支持

有好几种方案,我使用的是这种:

http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/

还有一种是:

https://pelle.io/2014/07/11/delivering-gui-applications-with-docker/

我没有试过。

 

3,安装swt-gtk

但是这时候运行swt程序,还是会抛如下错误:

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-gtk-3740 in java.library.path no swt-gtk in java.library.path Can't load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk-3740.so

Can't load library: /home/gabriel/.swt/lib/linux/x86_64/libswt-gtk.so

需要:

1) 添加architecture i386

sudo dpkg --add-architecture i386

sudo apt-get update

参考:

http://askubuntu.com/questions/463457/how-to-find-packages-when-updating-ubuntu-and-creating-standard-source-list-file

http://askubuntu.com/questions/551840/unable-to-locate-package-libc6-dbgi386-in-docker

2)安装gtk

sudo apt-get install libgtk2.0-0:i386

参考:

http://askubuntu.com/questions/232691/cannot-open-shared-object-file-no-such-file-or-directory

3)安装swt支持

sudo apt-get install libswt-gtk-3-jni libswt-gtk-3-java

并拷贝到

sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86_64/

参考http://askubuntu.com/questions/125150/unsatisfied-link-error-and-missing-so-files-when-starting-eclipse

使Docker Container支持运行SWT程序的更多相关文章

  1. 在 Docker 容器中运行应用程序

    案例说明 运行 3 个容器,实现对网站的监控. 三个容器的说明: 容器 web: 创建自 nginx 映像,使用 80 端口,运行于后台,实现 web 服务. 容器 mailer: 该容器中运行一个 ...

  2. 在docker container中运行docker-compose

    为了保持宿主主机的环境干净,因此将docker-compose安装到一个基于centos7.3的容器之中,因为tianchao屏蔽了amazonaws,最后选择了通过pip方式来安装,这也是官方推荐的 ...

  3. 关于运行SWT程序遇到的一个错误的总结

    具体的错误信息如下: Exception in thread "main" java.lang.SecurityException: SHA1 digest error for o ...

  4. 在Docker for Windows中运行GUI程序

    Docker运行GUI原理 Docker目前大多应用在服务器领域,那么在Docker中可以运行GUI程序吗?怀着好奇心google了一番,还真有人写了一篇文章 running-gui-applicat ...

  5. Docker源码分析(七):Docker Container网络 (上)

    1.前言(什么是Docker Container) 如今,Docker技术大行其道,大家在尝试以及玩转Docker的同时,肯定离不开一个概念,那就是“容器”或者“Docker Container”.那 ...

  6. 如何在查看docker container内进程信息,与宿主机上进程信息的映射关系

    docker container内运行的进程,在宿主机上,通过ps也是能够查到的,但是在不熟悉命令的时候,无法快速找到他们的关系. 这里科普一个基础命令 docker top 1. 找到容器的id d ...

  7. 【转】如何配置EditPlus中Java运行环境,运行Java程序

    如何配置EditPlus中Java运行环境,运行Java程序 http://jingyan.baidu.com/article/86112f13725e2e2736978711.html 分步阅读 E ...

  8. Docker4Windows -- 从外部(非本机host)访问 由docker container运行的程序

    背景 当我们在windows 上面运行docker container的时候,我们需要借助于模拟器(例如,Virtual box/Hyper V),她的目的主要是在我们的windows系统上面模拟出一 ...

  9. 如何在一个Docker中同时运行多个程序进程?

    我们都知道Docker容器的哲学是一个Docker容器只运行一个进程,但是有时候我们就是需要在一个Docker容器中运行多个进程 那么基本思路是在Dockerfile 的CMD 或者 ENTRYPOI ...

随机推荐

  1. js检测手机摇一摇

    1.检测设备是否支持重力感应事件deviceorientation deviceorientation 提供设备的物理方向信息,表示为一系列本地坐标系的旋角 function motionHandle ...

  2. ECshop通过文章分类的ID实现不同模板

    当客户需要想要用不同模板来实现文章页面时,文章就需要实现调用不同模板的内容,着手点就是它的分类ID.直接通过分类ID来判断一下,现在68ecshop技术来告诉你该怎么做 方法如下所示: 一.打开根目录 ...

  3. phyton 相关学习

    http://www.nowamagic.net/academy/category/13/ http://www.runoob.com/python/python-reg-expressions.ht ...

  4. 五句话搞定JavaScript作用域

    JavaScript的作用域一直以来是前端开发中比较难以理解的知识点,对于JavaScript的作用域主要记住几句话,走遍天下都不怕... 一.“JavaScript中无块级作用域” 在Java或C# ...

  5. jQuery 跨域访问的三种方式 No 'Access-Control-Allow-Origin' header is present on the reque

    问题: XMLHttpRequest cannot load http://v.xxx.com. No 'Access-Control-Allow-Origin' header is present ...

  6. 基本C语言滤波算法

    11种软件滤波方法的示例程序 假定从8位AD中读取数据(如果是更高位的AD可定义数据类型为int),子程序为get_ad(); 1.限副滤波 /*  A值可根据实际情况调整 value为有效值,new ...

  7. 浏览器桌面通知--Notification

    前言 最近项目上要用到浏览器桌面通知,之前虽然知道有这个东西,但是一直没有用过,借此机会了解下桌面通知的机制,在此分享下. 1.权限 首先需要明确的是,不是所有网页都可以发桌面通知的,不然不得烦死,那 ...

  8. Leetcode: Encode String with Shortest Length && G面经

    Given a non-empty string, encode the string such that its encoded length is the shortest. The encodi ...

  9. Leetcode: Sentence Screen Fitting

    Given a rows x cols screen and a sentence represented by a list of words, find how many times the gi ...

  10. Pointcut is malformed: Pointcut is not well-formed: expecting 'identifier' at character position 0 ^

    错误提示: 解决方法:指定execution 在执行目标方法之前指定execution 例如: import org.aspectj.lang.annotation.Aspect; import or ...