From 7a39a8c566f3fce4c3477b9e8933f0b1fe17fc53 Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Fri, 4 Aug 2023 16:55:01 +0530 Subject: [PATCH] Use dockerfile to build skopeo version 1.13.0 --- .github/workflows/podman_tests.yaml | 4 +++- hack/skopeo.Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 hack/skopeo.Dockerfile diff --git a/.github/workflows/podman_tests.yaml b/.github/workflows/podman_tests.yaml index 8dacb0f6c9..d68fba64ca 100644 --- a/.github/workflows/podman_tests.yaml +++ b/.github/workflows/podman_tests.yaml @@ -14,10 +14,12 @@ jobs: uses: taiki-e/install-action@just - name: Install requirements run: sudo env PATH=$PATH just ci-prepare + - name: Build latest skopeo # because ubuntu 22.04 does not have latest, and podman tests depend on that + run: docker build -f ./hack/skopeo.dockerfile . --target skopeo-rootfs --output=/ && skopeo --version - run: just youki-dev - run: sudo cp youki /usr/local/bin - name: Install requirements for Podman - run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev libgpgme-dev bats + run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev libgpgme-dev bats skopeo - name: Clone podman repository uses: actions/checkout@v3 with: diff --git a/hack/skopeo.Dockerfile b/hack/skopeo.Dockerfile new file mode 100644 index 0000000000..b432548ee2 --- /dev/null +++ b/hack/skopeo.Dockerfile @@ -0,0 +1,23 @@ +# ref https://github.com/containers/skopeo/issues/1648#issuecomment-1132161659 +FROM golang:1.20 AS skopeo-build + +WORKDIR /usr/src/skopeo + +ARG SKOPEO_VERSION="1.13.1" +RUN curl -fsSL "https://github.com/containers/skopeo/archive/v${SKOPEO_VERSION}.tar.gz" \ + | tar -xzf - --strip-components=1 + +RUN CGO_ENABLED=0 DISABLE_DOCS=1 make BUILDTAGS=containers_image_openpgp GO_DYN_FLAGS= + +RUN ./bin/skopeo --version + + +FROM scratch AS skopeo-rootfs + +COPY --from=skopeo-build /usr/src/skopeo/bin/skopeo /usr/local/bin/ +COPY --from=skopeo-build /usr/src/skopeo/default-policy.json /etc/containers/policy.json + + +FROM scratch + +COPY --from=skopeo-rootfs / / \ No newline at end of file