eclipse - 使用 docker 运行 eclipse

标签 eclipse docker user-interface

我被分配了一个项目,在 docker 中安装 tomcat9、spring-5.7 和 eclipse 并创建 docker 镜像。


以下是我的 dockerfile:

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt update && apt upgrade -y
RUN apt-get install apt-utils sudo -y

# INSTALL UTILITIES WGET AND TAR
RUN apt-get install wget tar -y

# INSTALL MAVEN GRADLE AND JDK
RUN apt-get install maven gradle default-jdk -y

# INSTALL ECLIPSE
RUN wget http://mirror.tspu.ru/eclipse/technology/epp/downloads/release/2020-06/R/eclipse-jee-2020-06-R-linux-gtk-x86_64.tar.gz -P /opt
RUN cd /opt && tar xvzf eclipse-jee-2020-06-R-linux-gtk-x86_64.tar.gz

# INSTALL TOMCAT
RUN apt-get install tomcat9 -y
EXPOSE 8080

# INSTALL SPRING LIBRARIES
RUN mkdir "/usr/local/spring-v5.2.7"
RUN wget "https://repo.spring.io/release/org/springframework/spring/5.2.7.RELEASE/spring-5.2.7.RELEASE-dist.zip" -P "/usr/local/spring-v5.2.7/"
RUN unzip "/usr/local/spring-v5.2.7/spring-5.2.7.RELEASE-dist.zip"

# INSTALL GEDIT
RUN apt-get install gedit -y

ENTRYPOINT /opt/eclipse/eclipse

(还在开发中,从tomcat刚刚安装好,还没有启动就可以看出)


现在,这是我用来运行容器的命令:

docker container run --rm --net=host -it --env=DISPLAY --volume=$HOME/.Xauthority:/root/.Xauthority:rw microservices-docker

一件奇怪的事情是我的 eclipse 给出了 this当 docker 在没有 gedit 的情况下构建时会出现错误,而当 gedit 添加到镜像时则运行顺利(嗯,有正常的 dbus 错误)。


我的问题是,gedit 安装了哪些额外软件包,使容器能够顺利运行?

最佳答案

Eclipse 2020-06 (4.16) requires GTK 3.20 or higher 。我猜想,这个要求是作为执行 apt-get install gedit -y 的副作用而得到满足的。

正如您自己发现的那样,您也可以只安装以下软件包:

  • libgtk-3-0:am​​d64
  • libgtk-3-bin
  • libgtk-3-common
  • libgtksourceview-3.0-1:amd64
  • libgtksourceview-3.0-common

关于eclipse - 使用 docker 运行 eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63049621/

相关文章:

xml - 将 XML 文件与 Eclipse XML 编辑器相关联

java - 在 Eclipse 服务器中运行的简单 Spring 应用程序,但未部署在 Tomcat 中

java - Android Studio AndroidManifest.xml 与 build.gradle

linux - 如何在 docker 中使用主机 DISPLAY

user-interface - 有没有办法在 Rebol 中将 gui 按钮和字段居中?

windows - 有没有办法改变非客户区的 Windows Aero 颜色?

eclipse - Eclipse中的JUnit测试一起运行时失败

selenium - 使用 Pytest 、 Selenium Grid 和 Docker 创建测试基础设施

docker - 使用buildroot发行版作为docker * host *

qt - 在Qt5中绘制大量独立字符的最佳方法?