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