From: Mark Hansen Date: Sat, 16 May 2020 05:04:29 +0000 (+1000) Subject: Collapse CI Dockerfile into a single layer X-Git-Tag: 2.44.1~65^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=167dc46f5c003f913d37428f8567e99008edd004;p=graphviz Collapse CI Dockerfile into a single layer Speed up CI Docker build: apt-get update once This is cribbed from https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get, particularly the 'well-formed RUN instruction that demonstrates all the apt-get recommendations'. This ensures that: - apt-get has a lot of parallelism available to speed up downloading of packages - apt-get only has to read package information into memory once (speeding up the build) - one single revision of the Ubuntu package sets are used by all apt-get installs (previously if Ubuntu updates packages between RUN commands we might get packages from different revisions - unlikely but possible) - the /var/lib/apt/lists/* files are not present in any docker filesystem layer, saving space (previously they were present in all layers but the last layer, so the removal at the end didn't save any space) --- diff --git a/ci/ubuntu-18.04/Dockerfile b/ci/ubuntu-18.04/Dockerfile index 3af59e0d6..7b2143b92 100644 --- a/ci/ubuntu-18.04/Dockerfile +++ b/ci/ubuntu-18.04/Dockerfile @@ -2,106 +2,79 @@ FROM ubuntu:18.04 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y - +RUN apt-get update -y \ +&& apt-get install --no-install-recommends -y \ # Development tools -RUN apt-get update && apt-get install --no-install-recommends -y build-essential -RUN apt-get update && apt-get install --no-install-recommends -y git -RUN apt-get update && apt-get install --no-install-recommends -y pkg-config -RUN apt-get update && apt-get install --no-install-recommends -y autoconf -RUN apt-get update && apt-get install --no-install-recommends -y bison -RUN apt-get update && apt-get install --no-install-recommends -y libtool -RUN apt-get update && apt-get install --no-install-recommends -y flex - +build-essential \ +git \ +pkg-config \ +autoconf \ +bison \ +libtool \ +flex \ # Debian build utilities -RUN apt-get update && apt-get install --no-install-recommends -y quilt -RUN apt-get update && apt-get install --no-install-recommends -y d-shlibs -RUN apt-get update && apt-get install --no-install-recommends -y debhelper -RUN apt-get update && apt-get install --no-install-recommends -y fakeroot - +quilt \ +d-shlibs \ +debhelper \ +fakeroot \ # Option glut -RUN apt-get update && apt-get install --no-install-recommends -y freeglut3-dev - +freeglut3-dev \ # Option gts -RUN apt-get update && apt-get install --no-install-recommends -y libgts-dev - +libgts-dev \ # Option swig -RUN apt-get update && apt-get install --no-install-recommends -y swig - +swig \ # Command lefty -RUN apt-get update && apt-get install --no-install-recommends -y libxaw7-dev - +libxaw7-dev \ # Command smyra -RUN apt-get update && apt-get install --no-install-recommends -y libgtkglext1-dev -RUN apt-get update && apt-get install --no-install-recommends -y libglade2-dev - +libgtkglext1-dev \ +libglade2-dev \ # Command gvedit -RUN apt-get update && apt-get install --no-install-recommends -y libqt5gui5 -RUN apt-get update && apt-get install --no-install-recommends -y qt5-qmake -RUN apt-get update && apt-get install --no-install-recommends -y qt5-default - +libqt5gui5 \ +qt5-qmake \ +qt5-default \ # Plugin library devil -RUN apt-get update && apt-get install --no-install-recommends -y libdevil-dev - +libdevil-dev \ # Plugin library gd -RUN apt-get update && apt-get install --no-install-recommends -y libgd-dev - +libgd-dev \ # Plugin library ghostscipt -RUN apt-get update && apt-get install --no-install-recommends -y libgs-dev - +libgs-dev \ # Plugin library lasi -RUN apt-get update && apt-get install --no-install-recommends -y liblasi-dev - +liblasi-dev \ # Plugin library poppler -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-dev -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-glib-dev - +libpoppler-dev \ +libpoppler-glib-dev \ # Plugin library rsvg -RUN apt-get update && apt-get install --no-install-recommends -y librsvg2-dev - +librsvg2-dev \ # Plugin library webp -RUN apt-get update && apt-get install --no-install-recommends -y libwebp-dev - +libwebp-dev \ # Language extension gv_sharp & gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby - +ruby \ # Language extension gv_go -RUN apt-get update && apt-get install --no-install-recommends -y golang-go - +golang-go \ # Language extension gv_guile -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2 -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2-dev - +guile-2.2 \ +guile-2.2-dev \ # Language extension gv_lua -RUN apt-get update && apt-get install --no-install-recommends -y liblualib50-dev -RUN apt-get update && apt-get install --no-install-recommends -y liblua5.3-dev - +liblualib50-dev \ +liblua5.3-dev \ # Language extension gv_ocaml -RUN apt-get update && apt-get install --no-install-recommends -y ocaml - +ocaml \ # Language extension gv_perl -RUN apt-get update && apt-get install --no-install-recommends -y libperl-dev - +libperl-dev \ # Language extension gv_php -RUN apt-get update && apt-get install --no-install-recommends -y php-dev -RUN apt-get update && apt-get install --no-install-recommends -y libsodium-dev -RUN apt-get update && apt-get install --no-install-recommends -y libargon2-0-dev - +php-dev \ +libsodium-dev \ +libargon2-0-dev \ # Language extension gv_python & gv_python2 -RUN apt-get update && apt-get install --no-install-recommends -y python2.7-dev - +python2.7-dev \ # Language extension gv_python3 -RUN apt-get update && apt-get install --no-install-recommends -y libpython3-dev - +libpython3-dev \ # Language extension gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby-dev - +ruby-dev \ # Language extension gv_tcl -RUN apt-get update && apt-get install --no-install-recommends -y tcl-dev - +tcl-dev \ # Test utilities -RUN apt-get update && apt-get install --no-install-recommends -y python-pytest -RUN apt-get update && apt-get install --no-install-recommends -y python3-pytest - +python-pytest \ +python3-pytest \ # Clean up -RUN rm -rf /var/lib/apt/lists/* +&& rm -rf /var/lib/apt/lists/* diff --git a/ci/ubuntu-19.04/Dockerfile b/ci/ubuntu-19.04/Dockerfile index 8a3f018c8..4e7ea18c8 100644 --- a/ci/ubuntu-19.04/Dockerfile +++ b/ci/ubuntu-19.04/Dockerfile @@ -2,106 +2,79 @@ FROM ubuntu:19.04 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y - +RUN apt-get update -y \ +&& apt-get install --no-install-recommends -y \ # Development tools -RUN apt-get update && apt-get install --no-install-recommends -y build-essential -RUN apt-get update && apt-get install --no-install-recommends -y git -RUN apt-get update && apt-get install --no-install-recommends -y pkg-config -RUN apt-get update && apt-get install --no-install-recommends -y autoconf -RUN apt-get update && apt-get install --no-install-recommends -y bison -RUN apt-get update && apt-get install --no-install-recommends -y libtool -RUN apt-get update && apt-get install --no-install-recommends -y flex - +build-essential \ +git \ +pkg-config \ +autoconf \ +bison \ +libtool \ +flex \ # Debian build utilities -RUN apt-get update && apt-get install --no-install-recommends -y quilt -RUN apt-get update && apt-get install --no-install-recommends -y d-shlibs -RUN apt-get update && apt-get install --no-install-recommends -y debhelper -RUN apt-get update && apt-get install --no-install-recommends -y fakeroot - +quilt \ +d-shlibs \ +debhelper \ +fakeroot \ # Option glut -RUN apt-get update && apt-get install --no-install-recommends -y freeglut3-dev - +freeglut3-dev \ # Option gts -RUN apt-get update && apt-get install --no-install-recommends -y libgts-dev - +libgts-dev \ # Option swig -RUN apt-get update && apt-get install --no-install-recommends -y swig - +swig \ # Command lefty -RUN apt-get update && apt-get install --no-install-recommends -y libxaw7-dev - +libxaw7-dev \ # Command smyra -RUN apt-get update && apt-get install --no-install-recommends -y libgtkglext1-dev -RUN apt-get update && apt-get install --no-install-recommends -y libglade2-dev - +libgtkglext1-dev \ +libglade2-dev \ # Command gvedit -RUN apt-get update && apt-get install --no-install-recommends -y libqt5gui5 -RUN apt-get update && apt-get install --no-install-recommends -y qt5-qmake -RUN apt-get update && apt-get install --no-install-recommends -y qt5-default - +libqt5gui5 \ +qt5-qmake \ +qt5-default \ # Plugin library devil -RUN apt-get update && apt-get install --no-install-recommends -y libdevil-dev - +libdevil-dev \ # Plugin library gd -RUN apt-get update && apt-get install --no-install-recommends -y libgd-dev - +libgd-dev \ # Plugin library ghostscipt -RUN apt-get update && apt-get install --no-install-recommends -y libgs-dev - +libgs-dev \ # Plugin library lasi -RUN apt-get update && apt-get install --no-install-recommends -y liblasi-dev - +liblasi-dev \ # Plugin library poppler -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-dev -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-glib-dev - +libpoppler-dev \ +libpoppler-glib-dev \ # Plugin library rsvg -RUN apt-get update && apt-get install --no-install-recommends -y librsvg2-dev - +librsvg2-dev \ # Plugin library webp -RUN apt-get update && apt-get install --no-install-recommends -y libwebp-dev - +libwebp-dev \ # Language extension gv_sharp & gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby - +ruby \ # Language extension gv_go -RUN apt-get update && apt-get install --no-install-recommends -y golang-go - +golang-go \ # Language extension gv_guile -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2 -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2-dev - +guile-2.2 \ +guile-2.2-dev \ # Language extension gv_lua -RUN apt-get update && apt-get install --no-install-recommends -y lua5.3 -RUN apt-get update && apt-get install --no-install-recommends -y liblua5.3-dev - +lua5.3 \ +liblua5.3-dev \ # Language extension gv_ocaml -RUN apt-get update && apt-get install --no-install-recommends -y ocaml - +ocaml \ # Language extension gv_perl -RUN apt-get update && apt-get install --no-install-recommends -y libperl-dev - +libperl-dev \ # Language extension gv_php -RUN apt-get update && apt-get install --no-install-recommends -y php-dev -RUN apt-get update && apt-get install --no-install-recommends -y libsodium-dev -RUN apt-get update && apt-get install --no-install-recommends -y libargon2-0-dev - +php-dev \ +libsodium-dev \ +libargon2-0-dev \ # Language extension gv_python & gv_python2 -RUN apt-get update && apt-get install --no-install-recommends -y python2.7-dev - +python2.7-dev \ # Language extension gv_python3 -RUN apt-get update && apt-get install --no-install-recommends -y libpython3-dev - +libpython3-dev \ # Language extension gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby-dev - +ruby-dev \ # Language extension gv_tcl -RUN apt-get update && apt-get install --no-install-recommends -y tcl-dev - +tcl-dev \ # Test utilities -RUN apt-get update && apt-get install --no-install-recommends -y python-pytest -RUN apt-get update && apt-get install --no-install-recommends -y python3-pytest - +python-pytest \ +python3-pytest \ # Clean up -RUN rm -rf /var/lib/apt/lists/* +&& rm -rf /var/lib/apt/lists/* diff --git a/ci/ubuntu-19.10/Dockerfile b/ci/ubuntu-19.10/Dockerfile index 14ff07d13..1ee141348 100644 --- a/ci/ubuntu-19.10/Dockerfile +++ b/ci/ubuntu-19.10/Dockerfile @@ -2,106 +2,79 @@ FROM ubuntu:19.10 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y - +RUN apt-get update -y \ +&& apt-get install --no-install-recommends -y \ # Development tools -RUN apt-get update && apt-get install --no-install-recommends -y build-essential -RUN apt-get update && apt-get install --no-install-recommends -y git -RUN apt-get update && apt-get install --no-install-recommends -y pkg-config -RUN apt-get update && apt-get install --no-install-recommends -y autoconf -RUN apt-get update && apt-get install --no-install-recommends -y bison -RUN apt-get update && apt-get install --no-install-recommends -y libtool -RUN apt-get update && apt-get install --no-install-recommends -y flex - +build-essential \ +git \ +pkg-config \ +autoconf \ +bison \ +libtool \ +flex \ # Debian build utilities -RUN apt-get update && apt-get install --no-install-recommends -y quilt -RUN apt-get update && apt-get install --no-install-recommends -y d-shlibs -RUN apt-get update && apt-get install --no-install-recommends -y debhelper -RUN apt-get update && apt-get install --no-install-recommends -y fakeroot - +quilt \ +d-shlibs \ +debhelper \ +fakeroot \ # Option glut -RUN apt-get update && apt-get install --no-install-recommends -y freeglut3-dev - +freeglut3-dev \ # Option gts -RUN apt-get update && apt-get install --no-install-recommends -y libgts-dev - +libgts-dev \ # Option swig -RUN apt-get update && apt-get install --no-install-recommends -y swig - +swig \ # Command lefty -RUN apt-get update && apt-get install --no-install-recommends -y libxaw7-dev - +libxaw7-dev \ # Command smyra -RUN apt-get update && apt-get install --no-install-recommends -y libgtkglext1-dev -RUN apt-get update && apt-get install --no-install-recommends -y libglade2-dev - +libgtkglext1-dev \ +libglade2-dev \ # Command gvedit -RUN apt-get update && apt-get install --no-install-recommends -y libqt5gui5 -RUN apt-get update && apt-get install --no-install-recommends -y qt5-qmake -RUN apt-get update && apt-get install --no-install-recommends -y qt5-default - +libqt5gui5 \ +qt5-qmake \ +qt5-default \ # Plugin library devil -RUN apt-get update && apt-get install --no-install-recommends -y libdevil-dev - +libdevil-dev \ # Plugin library gd -RUN apt-get update && apt-get install --no-install-recommends -y libgd-dev - +libgd-dev \ # Plugin library ghostscipt -RUN apt-get update && apt-get install --no-install-recommends -y libgs-dev - +libgs-dev \ # Plugin library lasi -RUN apt-get update && apt-get install --no-install-recommends -y liblasi-dev - +liblasi-dev \ # Plugin library poppler -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-dev -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-glib-dev - +libpoppler-dev \ +libpoppler-glib-dev \ # Plugin library rsvg -RUN apt-get update && apt-get install --no-install-recommends -y librsvg2-dev - +librsvg2-dev \ # Plugin library webp -RUN apt-get update && apt-get install --no-install-recommends -y libwebp-dev - +libwebp-dev \ # Language extension gv_sharp & gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby - +ruby \ # Language extension gv_go -RUN apt-get update && apt-get install --no-install-recommends -y golang-go - +golang-go \ # Language extension gv_guile -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2 -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2-dev - +guile-2.2 \ +guile-2.2-dev \ # Language extension gv_lua -RUN apt-get update && apt-get install --no-install-recommends -y lua5.3 -RUN apt-get update && apt-get install --no-install-recommends -y liblua5.3-dev - +lua5.3 \ +liblua5.3-dev \ # Language extension gv_ocaml -RUN apt-get update && apt-get install --no-install-recommends -y ocaml - +ocaml \ # Language extension gv_perl -RUN apt-get update && apt-get install --no-install-recommends -y libperl-dev - +libperl-dev \ # Language extension gv_php -RUN apt-get update && apt-get install --no-install-recommends -y php-dev -RUN apt-get update && apt-get install --no-install-recommends -y libsodium-dev -RUN apt-get update && apt-get install --no-install-recommends -y libargon2-0-dev - +php-dev \ +libsodium-dev \ +libargon2-0-dev \ # Language extension gv_python & gv_python2 -RUN apt-get update && apt-get install --no-install-recommends -y python2.7-dev - +python2.7-dev \ # Language extension gv_python3 -RUN apt-get update && apt-get install --no-install-recommends -y libpython3-dev - +libpython3-dev \ # Language extension gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby-dev - +ruby-dev \ # Language extension gv_tcl -RUN apt-get update && apt-get install --no-install-recommends -y tcl-dev - +tcl-dev \ # Test utilities -RUN apt-get update && apt-get install --no-install-recommends -y python-pytest -RUN apt-get update && apt-get install --no-install-recommends -y python3-pytest - +python-pytest \ +python3-pytest \ # Clean up -RUN rm -rf /var/lib/apt/lists/* +&& rm -rf /var/lib/apt/lists/* diff --git a/ci/ubuntu-20.04/Dockerfile b/ci/ubuntu-20.04/Dockerfile index 4bd1e17b6..6d119d768 100644 --- a/ci/ubuntu-20.04/Dockerfile +++ b/ci/ubuntu-20.04/Dockerfile @@ -2,107 +2,80 @@ FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y - +RUN apt-get update -y \ +&& apt-get install --no-install-recommends -y \ # Development tools -RUN apt-get update && apt-get install --no-install-recommends -y build-essential -RUN apt-get update && apt-get install --no-install-recommends -y git -RUN apt-get update && apt-get install --no-install-recommends -y pkg-config -RUN apt-get update && apt-get install --no-install-recommends -y autoconf -RUN apt-get update && apt-get install --no-install-recommends -y bison -RUN apt-get update && apt-get install --no-install-recommends -y libtool -RUN apt-get update && apt-get install --no-install-recommends -y flex -RUN apt-get update && apt-get install --no-install-recommends -y ksh - +build-essential \ +git \ +pkg-config \ +autoconf \ +bison \ +libtool \ +flex \ +ksh \ # Debian build utilities -RUN apt-get update && apt-get install --no-install-recommends -y quilt -RUN apt-get update && apt-get install --no-install-recommends -y d-shlibs -RUN apt-get update && apt-get install --no-install-recommends -y debhelper -RUN apt-get update && apt-get install --no-install-recommends -y fakeroot - +quilt \ +d-shlibs \ +debhelper \ +fakeroot \ # Option glut -RUN apt-get update && apt-get install --no-install-recommends -y freeglut3-dev - +freeglut3-dev \ # Option gts -RUN apt-get update && apt-get install --no-install-recommends -y libgts-dev - +libgts-dev \ # Option swig -RUN apt-get update && apt-get install --no-install-recommends -y swig - +swig \ # Command lefty -RUN apt-get update && apt-get install --no-install-recommends -y libxaw7-dev - +libxaw7-dev \ # Command smyra -RUN apt-get update && apt-get install --no-install-recommends -y libgtkglext1-dev -RUN apt-get update && apt-get install --no-install-recommends -y libglade2-dev - +libgtkglext1-dev \ +libglade2-dev \ # Command gvedit -RUN apt-get update && apt-get install --no-install-recommends -y libqt5gui5 -RUN apt-get update && apt-get install --no-install-recommends -y qt5-qmake -RUN apt-get update && apt-get install --no-install-recommends -y qt5-default - +libqt5gui5 \ +qt5-qmake \ +qt5-default \ # Plugin library devil -RUN apt-get update && apt-get install --no-install-recommends -y libdevil-dev - +libdevil-dev \ # Plugin library gd -RUN apt-get update && apt-get install --no-install-recommends -y libgd-dev - +libgd-dev \ # Plugin library ghostscipt -RUN apt-get update && apt-get install --no-install-recommends -y libgs-dev - +libgs-dev \ # Plugin library lasi -RUN apt-get update && apt-get install --no-install-recommends -y liblasi-dev - +liblasi-dev \ # Plugin library poppler -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-dev -RUN apt-get update && apt-get install --no-install-recommends -y libpoppler-glib-dev - +libpoppler-dev \ +libpoppler-glib-dev \ # Plugin library rsvg -RUN apt-get update && apt-get install --no-install-recommends -y librsvg2-dev - +librsvg2-dev \ # Plugin library webp -RUN apt-get update && apt-get install --no-install-recommends -y libwebp-dev - +libwebp-dev \ # Language extension gv_sharp & gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby - +ruby \ # Language extension gv_go -RUN apt-get update && apt-get install --no-install-recommends -y golang-go - +golang-go \ # Language extension gv_guile -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2 -RUN apt-get update && apt-get install --no-install-recommends -y guile-2.2-dev - +guile-2.2 \ +guile-2.2-dev \ # Language extension gv_lua -RUN apt-get update && apt-get install --no-install-recommends -y lua5.3 -RUN apt-get update && apt-get install --no-install-recommends -y liblua5.3-dev - +lua5.3 \ +liblua5.3-dev \ # Language extension gv_ocaml -RUN apt-get update && apt-get install --no-install-recommends -y ocaml - +ocaml \ # Language extension gv_perl -RUN apt-get update && apt-get install --no-install-recommends -y libperl-dev - +libperl-dev \ # Language extension gv_php -RUN apt-get update && apt-get install --no-install-recommends -y php-dev -RUN apt-get update && apt-get install --no-install-recommends -y libsodium-dev -RUN apt-get update && apt-get install --no-install-recommends -y libargon2-0-dev - +php-dev \ +libsodium-dev \ +libargon2-0-dev \ # Language extension gv_python & gv_python2 -RUN apt-get update && apt-get install --no-install-recommends -y python2.7-dev - +python2.7-dev \ # Language extension gv_python3 -RUN apt-get update && apt-get install --no-install-recommends -y libpython3-dev - +libpython3-dev \ # Language extension gv_ruby -RUN apt-get update && apt-get install --no-install-recommends -y ruby-dev - +ruby-dev \ # Language extension gv_tcl -RUN apt-get update && apt-get install --no-install-recommends -y tcl-dev - +tcl-dev \ # Test utilities -RUN apt-get update && apt-get install --no-install-recommends -y python-pytest -RUN apt-get update && apt-get install --no-install-recommends -y python3-pytest - +python-pytest \ +python3-pytest \ # Clean up -RUN rm -rf /var/lib/apt/lists/* +&& rm -rf /var/lib/apt/lists/*