1+ # == FROM instructions support variables that are declared by
2+ # any ARG instructions that occur before the first FROM
3+ # ref: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
4+ #
5+ # To overwrite the build args use:
6+ # docker build ... --build-arg UBUNTU_DATE=20171006
7+ ARG UBUNTU_FLAVOR=xenial
8+ ARG UBUNTU_DATE=20171006
9+
110# == Ubuntu xenial is 16.04, i.e. FROM ubuntu:16.04
211# Find latest images at https://hub.docker.com/r/library/ubuntu/
3- # Layer size: big: 127.2 MB
4- FROM ubuntu:xenial-20170915
5- ENV UBUNTU_FLAVOR="xenial" \
6- UBUNTU_DATE="20170915"
12+ # Layer size: ~122 MB
13+ FROM ubuntu:${UBUNTU_FLAVOR}-${UBUNTU_DATE}
14+
15+ # == An ARG declared before a FROM is outside of a build stage,
16+ # so it can’t be used in any instruction after a FROM. To use
17+ # the default value of an ARG declared before the first
18+ # FROM use an ARG instruction without a value inside of a build stage
19+ # ref: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
20+ ARG UBUNTU_FLAVOR
21+ ARG UBUNTU_DATE
22+
23+ # Docker build debug logging, green colored
24+ RUN printf "\0 33[1;32mFROM ubuntu:${UBUNTU_FLAVOR}-${UBUNTU_DATE} \0 33[0m\n "
725
826# == Ubuntu flavors - common
927RUN echo "deb http://archive.ubuntu.com/ubuntu ${UBUNTU_FLAVOR} main universe\n " > /etc/apt/sources.list \
1028 && echo "deb http://archive.ubuntu.com/ubuntu ${UBUNTU_FLAVOR}-updates main universe\n " >> /etc/apt/sources.list \
1129 && echo "deb http://archive.ubuntu.com/ubuntu ${UBUNTU_FLAVOR}-security main universe\n " >> /etc/apt/sources.list
1230
13- MAINTAINER Team TIP <elgalu3+team-tip @gmail.com>
31+ MAINTAINER Leo Gallucci <elgalu3+dosel @gmail.com>
1432# https://github.com/docker/docker/pull/25466#discussion-diff-74622923R677
15- LABEL maintainer "Team TIP <elgalu3+team-tip @gmail.com>"
33+ LABEL maintainer "Leo Gallucci <elgalu3+dosel @gmail.com>"
1634
1735# No interactive frontend during docker build
1836ENV DEBIAN_FRONTEND=noninteractive \
@@ -23,6 +41,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
2341# ref: https://github.com/nodejs/docker-node/issues/340#issuecomment-321669029
2442# ref: http://askubuntu.com/a/235911/134645
2543# ref: https://github.com/moby/moby/issues/20022#issuecomment-182169732
44+ # How to remove keys? e.g. sudo apt-key del 2EA8F35793D8809A
2645RUN set -ex \
2746 && for key in \
2847 2EA8F35793D8809A \
@@ -36,7 +55,6 @@ RUN set -ex \
3655 gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
3756 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
3857 done
39- # How to remove keys? e.g. sudo apt-key del 2EA8F35793D8809A
4058
4159# ========================
4260# Miscellaneous packages
@@ -236,12 +254,18 @@ RUN apt-get -qqy update \
236254USER seluser
237255WORKDIR /home/seluser
238256
257+ # Docker backward compatibility
258+ RUN echo "${UBUNTU_FLAVOR}" > UBUNTU_FLAVOR \
259+ && echo "${UBUNTU_DATE}" > UBUNTU_DATE
260+
239261# =================
240262# Selenium latest
241263# =================
242264# Layer size: medium ~22 MB
243265ENV SEL_DIRECTORY="3.6" \
244266 SEL_VER="3.6.0"
267+
268+ RUN echo $SEL_VER
245269RUN export SELBASE="https://selenium-release.storage.googleapis.com" \
246270 && export SELPATH="${SEL_DIRECTORY}/selenium-server-standalone-${SEL_VER}.jar" \
247271 && wget -nv ${SELBASE}/${SELPATH} \
@@ -603,12 +627,12 @@ RUN wget --no-verbose -O geckodriver.tar.gz \
603627# ===============
604628# TODO: Use Google fingerprint to verify downloads
605629# https://www.google.de/linuxrepositories/
606- ENV CHROME_VERSION_TRIGGER="61 .0.3163.100 " \
630+ ENV CHROME_VERSION_TRIGGER="62 .0.3202.62 " \
607631 CHROME_URL="https://dl.google.com/linux/direct" \
608632 CHROME_BASE_DEB_PATH="/home/seluser/chrome-deb/google-chrome" \
609633 GREP_ONLY_NUMS_VER="[0-9.]{2,20}"
610634
611- LABEL selenium_chrome_version "61 .0.3163.100 "
635+ LABEL selenium_chrome_version "62 .0.3202.62 "
612636
613637# Layer size: huge: 196.3 MB
614638RUN apt-get -qqy update \
0 commit comments