diff options
author | Ian Wienand <iwienand@redhat.com> | 2023-01-24 10:01:10 +1100 |
---|---|---|
committer | Ian Wienand <iwienand@redhat.com> | 2023-01-24 13:26:42 +1100 |
commit | d071bfd2213e2f7ebeac99328a204b9d83e5bf13 (patch) | |
tree | 908492711757c111dfa2f461319c908dde905656 | |
parent | 944b9852c9f565ec433a808385d4ed0ad3f0abcc (diff) | |
download | zuul-d071bfd2213e2f7ebeac99328a204b9d83e5bf13.tar.gz |
Dockerfile: build later skopeo
skopeo has started failing with
unsupported MIME type for compression: application/vnd.in-toto+json
since the buildx v.10.0 release [1]. The version in bullseye is a
long way behind upstream, and unfortunately there's no practical way
to backport the package (it would require also pulling in a lot of
exploded out go container dependencies).
Thus we take the alternative solution of just building it ourselves
for the executor image. I couldn't figure out how to build this with
the Debian-packaged go (I think it has something to do with the
aforementioned libraries) but it works with the upstream monolith. It
produces a binary that is linked to a few local libraries, which are
installed here.
[1] https://github.com/containers/skopeo/issues/1874
Change-Id: Iab667a92a5b6e6f8591db2aa435a782913d9d34f
-rw-r--r-- | Dockerfile | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile index 51d28c0fb..9ef973e98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,15 @@ RUN /output/install-from-bindep \ && echo $OPENSHIFT_SHA /tmp/openshift-install/openshift-client.tgz | sha256sum --check \ && tar xvfz openshift-client.tgz -C /tmp/openshift-install + +FROM docker.io/library/golang:1.19-bullseye AS skopeo-builder +RUN apt-get update \ + && apt-get install -y git build-essential libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config \ + && git clone https://github.com/containers/skopeo.git \ + && cd skopeo && git checkout v1.9.3 \ + && make bin/skopeo \ + && cp bin/skopeo /tmp/skopeo + FROM docker.io/opendevorg/python-base:3.11-bullseye as zuul ENV DEBIAN_FRONTEND=noninteractive @@ -84,8 +93,11 @@ COPY --from=builder /tmp/openshift-install/oc /usr/local/bin/oc # Copy them only once and use a symlink to save space. RUN ln -s /usr/local/bin/oc /usr/local/bin/kubectl +# See note above about this workaround. These are the runtime +# dependencies, this should just install skopeo when we upgrade. +COPY --from=skopeo-builder /tmp/skopeo /usr/local/bin/skopeo RUN apt-get update \ - && apt-get install -y skopeo \ + && apt-get install -y libdevmapper1.02.1 libgpgme11 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* |