Skip to content

Commit

Permalink
Merge pull request #1856 from jericop/multi-arch-delivery-docker
Browse files Browse the repository at this point in the history
Update docker-delivery workflow to create multi-arch images
  • Loading branch information
jkutner authored Aug 4, 2023
2 parents dd4a8ad + 1bb7f0b commit 6939559
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/delivery-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,18 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pack Build/Publish
uses: dfreilich/pack-action@v2.1.1
env:
BP_GO_BUILD_LDFLAGS: "-s -w -X 'github.com/buildpacks/pack.Version=${{ steps.version.outputs.result }}'"
with:
args: 'build ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} --builder ${{ env.BUILDER }} --env BP_GO_BUILD_LDFLAGS --publish'
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: buildpacks/github-actions/setup-tools@v5.3.0
- name: Buildx Build/Publish
run: |
docker buildx build . \
--tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} \
--platform linux/amd64,linux/arm64 \
--build-arg pack_version=${{ steps.version.outputs.result }} \
--provenance=false \
--push
- name: Tag Image as Latest
if: ${{ github.event.release != '' || github.event.inputs.tag_latest }}
run: |
docker pull ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }}
docker tag ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:latest
docker push ${{ env.IMG_NAME }}:latest
crane copy ${{ env.IMG_NAME }}:${{ steps.version.outputs.result }} ${{ env.IMG_NAME }}:latest
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.20 as builder
ARG pack_version
ENV PACK_VERSION=$pack_version
WORKDIR /app
COPY . .
RUN make build

FROM scratch
COPY --from=builder /app/out/pack /usr/local/bin/pack
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT [ "/usr/local/bin/pack" ]

1 comment on commit 6939559

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6939559 Previous: dd4a8ad Ratio
BenchmarkBuild/with_Trusted_Builder 2874070173 ns/op 1335117473 ns/op 2.15

This comment was automatically generated by workflow using github-action-benchmark.

CC: @buildpacks/platform-maintainers

Please sign in to comment.