From c3395915a93ea090c4a8980b5eecdaeffa8b518d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 9 Dec 2022 11:16:33 -0800 Subject: 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 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 \ -- cgit v1.2.1