diff options
author | Clark Boylan <clark.boylan@gmail.com> | 2022-12-09 11:16:33 -0800 |
---|---|---|
committer | Clark Boylan <clark.boylan@gmail.com> | 2022-12-09 11:16:33 -0800 |
commit | c3395915a93ea090c4a8980b5eecdaeffa8b518d (patch) | |
tree | 61796acd52b1314a4d6f538bda893c2be2c00391 | |
parent | 532c30469ffc1a1b35d812455fa8271b392915cd (diff) | |
download | zuul-c3395915a93ea090c4a8980b5eecdaeffa8b518d.tar.gz |
Dedup the oc and kubectl commands in the docker images
These binaries are about 115MB each and we copy both of them.
Fortunately they are identical according to hashing routines so we can
save space by copying them once and using a symlink. We choose to make
`oc` the canonical file as these binaries come from openshift.
Change-Id: I3a34acf4ee20db935a471c4fa9ca5e2f7d297d39
-rw-r--r-- | Dockerfile | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile index 506ed7462..57243a101 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,8 +66,10 @@ CMD ["/usr/local/bin/zuul"] FROM zuul as zuul-executor ENV DEBIAN_FRONTEND=noninteractive COPY --from=builder /usr/local/lib/zuul/ /usr/local/lib/zuul -COPY --from=builder /tmp/openshift-install/kubectl /usr/local/bin/kubectl COPY --from=builder /tmp/openshift-install/oc /usr/local/bin/oc +# The oc and kubectl binaries are large and have the same hash. +# Copy them only once and use a symlink to save space. +RUN ln -s /usr/local/bin/oc /usr/local/bin/kubectl RUN apt-get update \ && apt-get install -y skopeo \ |