From c888c0557224d1d0f70411608ca76637e47aa42f Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Sun, 16 Jun 2019 23:45:37 +0700 Subject: [PATCH 1/6] Auto restart x11vnc if crashes Related bug: https://bugs.launchpad.net/ubuntu/+source/x11vnc/+bug/1686084 --- supervisord.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/supervisord.conf b/supervisord.conf index 9ef4949..ba36e0a 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -21,6 +21,7 @@ command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -nopw -forever -shared stdout_logfile=%(ENV_LOG_PATH)s/x11vnc.stdout.log stderr_logfile=%(ENV_LOG_PATH)s/x11vnc.stderr.log priority=2 +autorestart=true [program:novnc] command=./noVNC/utils/launch.sh --vnc localhost:%(ENV_LOCAL_PORT)s --listen %(ENV_TARGET_PORT)s From 359551e2725e71612c0d019567998d2e71a771fc Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Fri, 28 Jun 2019 11:34:30 +0700 Subject: [PATCH 2/6] Update x11vnc to prevent crash --- docker/Emulator_x86 | 3 +++ docker/sources1810.list | 2 ++ docker/x11vnc.pref | 9 +++++++++ release.sh | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker/sources1810.list create mode 100644 docker/x11vnc.pref diff --git a/docker/Emulator_x86 b/docker/Emulator_x86 index 9f3df53..2f4860a 100644 --- a/docker/Emulator_x86 +++ b/docker/Emulator_x86 @@ -21,6 +21,7 @@ WORKDIR /root #------------------ # x11vnc # VNC server for X display +# We use package from ubuntu 18.10 to fix crashing issue # openbox # Windows manager # menu @@ -46,6 +47,8 @@ WORKDIR /root # ubuntu-vm-builder # bridge-utils #================== +ADD ./sources1810.list /etc/sources.list.d/ +ADD ./x11vnc.pref /etc/apt/preferences.d/ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \ xterm \ supervisor \ diff --git a/docker/sources1810.list b/docker/sources1810.list new file mode 100644 index 0000000..97d0772 --- /dev/null +++ b/docker/sources1810.list @@ -0,0 +1,2 @@ +deb http://mirror.servers.com/ubuntu/ cosmic main restricted universe +deb http://security.ubuntu.com/ubuntu/ cosmic-security main restricted universe diff --git a/docker/x11vnc.pref b/docker/x11vnc.pref new file mode 100644 index 0000000..54da167 --- /dev/null +++ b/docker/x11vnc.pref @@ -0,0 +1,9 @@ +Package: * +Pin: release n=bionic +Pin-Priority: -10 +Package: x11vnc +Pin: release n=cosmic +Pin-Priority: 500 +Package: x11vnc-data +Pin: release n=cosmic +Pin-Priority: 500 \ No newline at end of file diff --git a/release.sh b/release.sh index 8be68ce..a09f538 100755 --- a/release.sh +++ b/release.sh @@ -1,7 +1,7 @@ #!/bin/bash # Bash version should >= 4 to be able to run this script. -IMAGE="budtmo/docker-android" +IMAGE="$DOCKER_ORG/docker-android" if [ -z "$1" ]; then read -p "Task (test|build|push|all) : " TASK From ce9936b6dfeff4810fc0973fbc6279478ac41b19 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Fri, 28 Jun 2019 11:46:02 +0700 Subject: [PATCH 3/6] Update x11vnc to prevent crash - Fix PATH --- docker/Emulator_x86 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Emulator_x86 b/docker/Emulator_x86 index 2f4860a..7949f5e 100644 --- a/docker/Emulator_x86 +++ b/docker/Emulator_x86 @@ -47,8 +47,8 @@ WORKDIR /root # ubuntu-vm-builder # bridge-utils #================== -ADD ./sources1810.list /etc/sources.list.d/ -ADD ./x11vnc.pref /etc/apt/preferences.d/ +ADD docker/sources1810.list /etc/sources.list.d/ +ADD docker/x11vnc.pref /etc/apt/preferences.d/ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \ xterm \ supervisor \ From 455bf6023dc8e71a97d0164a52fc13aeeda87176 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Fri, 28 Jun 2019 13:52:00 +0700 Subject: [PATCH 4/6] Fix wrong path --- docker/Emulator_x86 | 2 +- docker/sources1810.list | 2 +- docker/x11vnc.pref | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docker/Emulator_x86 b/docker/Emulator_x86 index 7949f5e..a6e80e7 100644 --- a/docker/Emulator_x86 +++ b/docker/Emulator_x86 @@ -47,7 +47,7 @@ WORKDIR /root # ubuntu-vm-builder # bridge-utils #================== -ADD docker/sources1810.list /etc/sources.list.d/ +ADD docker/sources1810.list /etc/apt/sources.list.d/ ADD docker/x11vnc.pref /etc/apt/preferences.d/ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \ xterm \ diff --git a/docker/sources1810.list b/docker/sources1810.list index 97d0772..e64c003 100644 --- a/docker/sources1810.list +++ b/docker/sources1810.list @@ -1,2 +1,2 @@ -deb http://mirror.servers.com/ubuntu/ cosmic main restricted universe +deb http://archive.ubuntu.com/ubuntu/ cosmic main restricted universe deb http://security.ubuntu.com/ubuntu/ cosmic-security main restricted universe diff --git a/docker/x11vnc.pref b/docker/x11vnc.pref index 54da167..67a022f 100644 --- a/docker/x11vnc.pref +++ b/docker/x11vnc.pref @@ -1,9 +1,6 @@ Package: * Pin: release n=bionic Pin-Priority: -10 -Package: x11vnc -Pin: release n=cosmic -Pin-Priority: 500 -Package: x11vnc-data +Package: x11vnc* Pin: release n=cosmic Pin-Priority: 500 \ No newline at end of file From 7afe1c0e543dc43eba900e32fbca192b6ae7b48e Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Fri, 28 Jun 2019 13:56:04 +0700 Subject: [PATCH 5/6] Default value for DOCKER_ORG --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index a09f538..39a0629 100755 --- a/release.sh +++ b/release.sh @@ -1,7 +1,7 @@ #!/bin/bash # Bash version should >= 4 to be able to run this script. -IMAGE="$DOCKER_ORG/docker-android" +IMAGE="${DOCKER_ORG:-budtmo}/docker-android" if [ -z "$1" ]; then read -p "Task (test|build|push|all) : " TASK From 92acd04a5353425b210e17471de1441539cc8d88 Mon Sep 17 00:00:00 2001 From: Trinh Pham Date: Fri, 28 Jun 2019 15:09:36 +0700 Subject: [PATCH 6/6] Move Polyverse to top to reduce the image size --- docker/Emulator_x86 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docker/Emulator_x86 b/docker/Emulator_x86 index a6e80e7..08e7c34 100644 --- a/docker/Emulator_x86 +++ b/docker/Emulator_x86 @@ -7,6 +7,18 @@ LABEL maintainer "Budi Utomo " #============= WORKDIR /root +#=========== +# Polyverse +# https://polyverse.io/how-it-works/ +#=========== +ARG TOKEN=xxx + +RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \ + if [ $? -eq 0 ]; then \ + apt -y update && \ + apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \ + fi + #================== # General Packages #------------------ @@ -64,20 +76,9 @@ RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \ libvirt-bin \ ubuntu-vm-builder \ bridge-utils \ + && apt clean all \ && rm -rf /var/lib/apt/lists/* -#=========== -# Polyverse -# https://polyverse.io/how-it-works/ -#=========== -ARG TOKEN=xxx - -RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \ - if [ $? -eq 0 ]; then \ - apt -y update && \ - apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \ - fi - #======= # noVNC # Use same commit id that docker-selenium uses