From 19927d2aed34df65adb8b7e5cbd5011a51ecb380 Mon Sep 17 00:00:00 2001 From: Serhii Trykoza <7215259+strikoza@users.noreply.github.com> Date: Fri, 10 Apr 2020 20:48:49 +0300 Subject: [PATCH 1/2] Every RUN add 1 layer to Docker-image. You should avoid this. --- firefox/centos7/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/firefox/centos7/Dockerfile b/firefox/centos7/Dockerfile index d1892c4c..47ace21b 100644 --- a/firefox/centos7/Dockerfile +++ b/firefox/centos7/Dockerfile @@ -8,18 +8,18 @@ FROM centos:centos7 MAINTAINER The CentOS Project # Install the appropriate software -RUN yum -y update; yum clean all -RUN yum -y install epel-release; yum clean all -RUN yum -y install x11vnc firefox xorg-x11-server-Xvfb xorg-x11-twm tigervnc-server xterm xorg-x11-font dejavu-sans-fonts dejavu-serif-fonts xdotool; yum clean all +RUN yum -y update; yum clean all \ + && yum -y install epel-release; yum clean all \ + && yum -y install x11vnc firefox xorg-x11-server-Xvfb xorg-x11-twm tigervnc-server xterm xorg-x11-font dejavu-sans-fonts dejavu-serif-fonts xdotool; yum clean all # Add the xstartup file into the image ADD ./xstartup / RUN mkdir /.vnc -RUN x11vnc -storepasswd 123456 /.vnc/passwd -RUN \cp -f ./xstartup /.vnc/. -RUN chmod -v +x /.vnc/xstartup -RUN sed -i '/\/etc\/X11\/xinit\/xinitrc-common/a [ -x /usr/bin/firefox ] && /usr/bin/firefox &' /etc/X11/xinit/xinitrc + && x11vnc -storepasswd 123456 /.vnc/passwd \ + && \cp -f ./xstartup /.vnc/. \ + && chmod -v +x /.vnc/xstartup \ + && sed -i '/\/etc\/X11\/xinit\/xinitrc-common/a [ -x /usr/bin/firefox ] && /usr/bin/firefox &' /etc/X11/xinit/xinitrc EXPOSE 5901 From 408d67dcb17044cc3c2efeaa033025bf76ce88cc Mon Sep 17 00:00:00 2001 From: Serhii Trykoza <7215259+strikoza@users.noreply.github.com> Date: Fri, 10 Apr 2020 21:12:34 +0300 Subject: [PATCH 2/2] Fix. --- firefox/centos7/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox/centos7/Dockerfile b/firefox/centos7/Dockerfile index 47ace21b..c55f49d4 100644 --- a/firefox/centos7/Dockerfile +++ b/firefox/centos7/Dockerfile @@ -15,7 +15,7 @@ RUN yum -y update; yum clean all \ # Add the xstartup file into the image ADD ./xstartup / -RUN mkdir /.vnc +RUN mkdir /.vnc \ && x11vnc -storepasswd 123456 /.vnc/passwd \ && \cp -f ./xstartup /.vnc/. \ && chmod -v +x /.vnc/xstartup \