]> git.pld-linux.org Git - projects/cleanbuild.git/commitdiff
docker: use separate stage for COPY
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 30 Dec 2018 23:35:45 +0000 (01:35 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Sun, 30 Dec 2018 23:35:45 +0000 (01:35 +0200)
workaround for gitlab-runner umask issue

https://gitlab.com/gitlab-org/gitlab-runner/issues/1736

docker/Dockerfile

index bf46e731ced2c3d435ffa4ec8bf17dc2aec20679..e78d4b8e7a70c123df08fcd0bf17b0cb10a53c23 100644 (file)
@@ -1,7 +1,19 @@
 # create base image for cleanbuild
 
-FROM registry.gitlab.com/pld-linux/pld
+FROM registry.gitlab.com/pld-linux/pld AS base
 
+FROM base AS dist
+WORKDIR /dist
+
+COPY rpmmacros ./home/builder/.rpmmacros
+# overwrite with our config (it defines same path, but disabled)
+COPY localrpms.conf ./etc/poldek/source.conf
+
+# use sane permissions until solved upstream
+# https://gitlab.com/gitlab-org/gitlab-runner/issues/1736
+RUN chmod -R a+rX,og-w .
+
+FROM base
 RUN set -x \
        # first upgrade to latest
        && poldek --upgrade-dist \
@@ -18,15 +30,11 @@ RUN set -x \
        && poldek-config keep_downloads yes \
        && poldek --clean-whole
 
-# overwrite with our config (it defines same path, but disabled)
-COPY localrpms.conf /etc/poldek/source.conf
+COPY --from=dist /dist /
 
 # switch user
 USER builder
-
-WORKDIR /home/services/builder
-
-COPY rpmmacros .rpmmacros
+WORKDIR /home/builder
 
 # Use sleep to run forever
 CMD ["sleep", "infinity"]
This page took 0.11752 seconds and 4 git commands to generate.