我被分配了一个项目,在 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:amd64
- 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/