From 675dca18e0e1bf7f4eb2a580ab9eac038f8bdaf9 Mon Sep 17 00:00:00 2001 From: Natalie Arellano Date: Fri, 27 Oct 2023 12:41:30 -0400 Subject: [PATCH] Add buildpacksio/pack:-base images to delivery Signed-off-by: Natalie Arellano --- .github/workflows/delivery-docker.yml | 26 +++++++++---------- .../workflows/delivery/docker/project.toml | 7 ----- Dockerfile | 6 ++--- 3 files changed, 16 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/delivery/docker/project.toml diff --git a/.github/workflows/delivery-docker.yml b/.github/workflows/delivery-docker.yml index 5db2c7e4b..f66c1496d 100644 --- a/.github/workflows/delivery-docker.yml +++ b/.github/workflows/delivery-docker.yml @@ -16,12 +16,21 @@ on: default: false env: - BUILDER: "paketobuildpacks/builder-jammy-tiny" IMG_NAME: 'pack' USERNAME: 'buildpacksio' jobs: deliver-docker: + strategy: + matrix: + config: [tiny, base] + include: + - config: tiny + base_image: gcr.io/distroless/static + suffix: + - config: base + base_image: ubuntu:jammy + suffix: -base runs-on: ubuntu-latest steps: - name: Determine version @@ -42,16 +51,6 @@ jobs: uses: actions/checkout@v4 with: ref: v${{ steps.version.outputs.result }} - # This has to come after the first checkout, so it isn't clobbered - - name: Checkout delivery configuration - uses: actions/checkout@v4 - with: - path: ./head - - name: Setup Working Dir - shell: bash - run: | - rm project.toml || true - cp head/.github/workflows/delivery/docker/project.toml project.toml - name: Determine App Name run: 'echo "IMG_NAME=${{ env.USERNAME }}/${{ env.IMG_NAME }}" >> $GITHUB_ENV' - name: Login to Dockerhub @@ -65,12 +64,13 @@ jobs: - name: Buildx Build/Publish run: | docker buildx build . \ - --tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} \ + --tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }}${{ matrix.suffix }} \ --platform linux/amd64,linux/arm64 \ --build-arg pack_version=${{ steps.version.outputs.result }} \ + --build-arg base_image=${{ matrix.base_image }} \ --provenance=false \ --push - name: Tag Image as Latest - if: ${{ github.event.release != '' || github.event.inputs.tag_latest }} + if: ${{ github.event.release != '' || github.event.inputs.tag_latest }} && ${{ matrix.config != "base" }} run: | crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:latest diff --git a/.github/workflows/delivery/docker/project.toml b/.github/workflows/delivery/docker/project.toml deleted file mode 100644 index da9c5c982..000000000 --- a/.github/workflows/delivery/docker/project.toml +++ /dev/null @@ -1,7 +0,0 @@ -[project] -version = "1.0.2" -source-url = "https://github.com/buildpacks/pack" - -[[build.env]] -name = "BP_GO_TARGETS" -value = "./cmd/pack" diff --git a/Dockerfile b/Dockerfile index 70c75ed45..c81b2f0c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +ARG base_image=gcr.io/distroless/static + FROM golang:1.20 as builder ARG pack_version ENV PACK_VERSION=$pack_version @@ -5,8 +7,6 @@ WORKDIR /app COPY . . RUN make build -FROM scratch +FROM ${base_image} COPY --from=builder /app/out/pack /usr/local/bin/pack -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /tmp /tmp ENTRYPOINT [ "/usr/local/bin/pack" ]