diff --git a/.github/workflows/buildkit.yml b/.github/workflows/buildkit.yml index 8c655a1bae6a..b4e33a9b683a 100644 --- a/.github/workflows/buildkit.yml +++ b/.github/workflows/buildkit.yml @@ -135,6 +135,51 @@ jobs: path: ${{ env.DESTDIR }}/* if-no-files-found: error + prepare-smoketest: + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.platforms.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Create matrix + id: platforms + run: | + matrix="$(docker buildx bake binaries-smoketest --print | jq -cr '.target."binaries-smoketest".platforms')" + echo "matrix=$matrix" >> $GITHUB_OUTPUT + + smoketest: + runs-on: ubuntu-20.04 + needs: + - prepare-smoketest + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.prepare-smoketest.outputs.matrix) }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: ${{ env.SETUP_BUILDX_VERSION }} + driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} + buildkitd-flags: --debug + - + name: Test + uses: docker/bake-action@v4 + with: + targets: binaries-smoketest + set: | + *.platform=${{ matrix.platform }} + image: runs-on: ubuntu-22.04 needs: diff --git a/Dockerfile b/Dockerfile index f304b2fe8659..efcbb78de6ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -379,5 +379,18 @@ ENV BUILDKIT_HOST=unix:///run/user/1000/buildkit/buildkitd.sock VOLUME /home/user/.local/share/buildkit ENTRYPOINT ["rootlesskit", "buildkitd"] +# smoke tests +FROM --platform=$TARGETPLATFORM buildkit-export AS binaries-smoketest +WORKDIR /usr/local/bin +COPY --from=binaries / . +RUN apk add --no-cache file +RUN <