summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/docker/debian10
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2023-01-31 22:43:25 (GMT)
committerBrad King <brad.king@kitware.com>2023-02-06 15:13:06 (GMT)
commit354fdf2116e286947fc2c645827d530f5112aea4 (patch)
treef4d905319e289b896ab1ff6f7e0f31b6195dfdf9 /.gitlab/ci/docker/debian10
parent2a0c105cf08190284b288057c693eeddef5066fc (diff)
downloadCMake-354fdf2116e286947fc2c645827d530f5112aea4.zip
CMake-354fdf2116e286947fc2c645827d530f5112aea4.tar.gz
CMake-354fdf2116e286947fc2c645827d530f5112aea4.tar.bz2
ci: Reduce intermediate docker layers and final image size
Instead of `COPY` to get tar files, execute `RUN` w/ `--mount`. Note that this requires the docker "buildkit" feature to be enabled.
Diffstat (limited to '.gitlab/ci/docker/debian10')
-rw-r--r--.gitlab/ci/docker/debian10/Dockerfile15
-rwxr-xr-x.gitlab/ci/docker/debian10/install_iwyu.sh2
2 files changed, 8 insertions, 9 deletions
diff --git a/.gitlab/ci/docker/debian10/Dockerfile b/.gitlab/ci/docker/debian10/Dockerfile
index 34a4bf1..2d3ae3a 100644
--- a/.gitlab/ci/docker/debian10/Dockerfile
+++ b/.gitlab/ci/docker/debian10/Dockerfile
@@ -1,10 +1,10 @@
-FROM debian:10 as iwyu-build
+FROM debian:10 AS iwyu-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_iwyu.sh /root/install_iwyu.sh
RUN sh /root/install_iwyu.sh
-FROM debian:10 as rvm-build
+FROM debian:10 AS rvm-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_rvm.sh /root/install_rvm.sh
@@ -16,10 +16,9 @@ MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
-COPY --from=iwyu-build /root/iwyu.tar.gz /root/iwyu.tar.gz
-RUN tar -C / -xf /root/iwyu.tar.gz
-RUN ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0
+RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
+ tar -C / -xf /root/iwyu.tar \
+ && ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0
-COPY --from=rvm-build /root/rvm.tar /root/rvm.tar
-RUN tar -C /usr/local -xf /root/rvm.tar \
- && rm /root/rvm.tar
+RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
+ tar -C /usr/local -xf /root/rvm.tar
diff --git a/.gitlab/ci/docker/debian10/install_iwyu.sh b/.gitlab/ci/docker/debian10/install_iwyu.sh
index 54d26ef..260570e 100755
--- a/.gitlab/ci/docker/debian10/install_iwyu.sh
+++ b/.gitlab/ci/docker/debian10/install_iwyu.sh
@@ -29,4 +29,4 @@ cmake -GNinja \
..
ninja
DESTDIR=/root/iwyu-destdir ninja install
-tar -C /root/iwyu-destdir -cf /root/iwyu.tar.gz .
+tar -C /root/iwyu-destdir -cf /root/iwyu.tar .