]> granicus.if.org Git - graphviz/commitdiff
Collapse CI Dockerfile into a single layer
authorMark Hansen <mark@markhansen.co.nz>
Sat, 16 May 2020 05:04:29 +0000 (15:04 +1000)
committerMark Hansen <mark@markhansen.co.nz>
Sun, 17 May 2020 01:10:12 +0000 (11:10 +1000)
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)

ci/ubuntu-18.04/Dockerfile
ci/ubuntu-19.04/Dockerfile
ci/ubuntu-19.10/Dockerfile
ci/ubuntu-20.04/Dockerfile

index 3af59e0d690ba2c7af30c65f0279b2f10bd4516e..7b2143b926b345a6a432004da5479cb91f6acd40 100644 (file)
@@ -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/*
index 8a3f018c8933a1807a7c65e8a630e44416d86c18..4e7ea18c868ac43fb949d4a5833923aa66b47a44 100644 (file)
@@ -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/*
index 14ff07d134c16c9fdac0808cc1725f7bd5a137e8..1ee141348bd0a7cbc5fdeca460eb8903c3ca5a95 100644 (file)
@@ -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/*
index 4bd1e17b66e6a8ebc128d5933bd0faecbb9d0ff0..6d119d768da71878d88a1acbb3a07c3b02d457e1 100644 (file)
@@ -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/*