Skip to content

Commit

Permalink
redo build for base image, try the oci exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
4141done committed Jan 10, 2024
1 parent 1e32e13 commit 4a022b2
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,26 @@ jobs:
# network=host driver-opt needed to push to local registry
driver-opts: network=host
platforms: linux/amd64,linux/arm64
- name: Build and export oss image
# Since we can't push and save at the same time we push to the local registry so that
# other builds can have access to the image (loading it does not work with buildx)
- name: Build and push oss image to local registry
uses: docker/build-push-action@v5
with:
file: Dockerfile.oss
context: .
tags: localhost:5000/nginx-s3-gateway , localhost:5000/nginx-s3-gateway:oss
push: true
platforms: linux/amd64,linux/arm64
# Since the above build pushes to the registry only now we load it locally so we can save it
# It's not possible with push and save in one go.
- name: Load image oss
run: |
docker pull localhost:5000/nginx-s3-gateway
docker tag localhost:5000/nginx-s3-gateway nginx-s3-gateway
- name: save image for upload
run: |
docker save nginx-s3-gateway > /tmp/oss.tar
# Build again to export the file locally so we can save all arch versions.
- name: Build and export oss image
uses: docker/build-push-action@v5
with:
file: Dockerfile.oss
context: .
tags: localhost:5000/nginx-s3-gateway , localhost:5000/nginx-s3-gateway:oss
push: false
outputs: type=oci,dest=/tmp/oss.tar
platforms: linux/amd64,linux/arm64
- name: Upload artifact - oss
uses: actions/upload-artifact@v3
with:
Expand All @@ -82,7 +85,7 @@ jobs:
context: .
tags: localhost:5000/nginx-s3-gateway:latest-njs-oss
push: false
outputs: type=docker,dest=/tmp/latest-njs.tar
outputs: type=oci,dest=/tmp/latest-njs.tar
platforms: linux/amd64,linux/arm64
build-contexts: |
nginx-s3-gateway=docker-image://localhost:5000/nginx-s3-gateway:oss
Expand All @@ -99,7 +102,7 @@ jobs:
context: .
tags: localhost:5000/nginx-s3-gateway:unprivileged
push: false
outputs: type=docker,dest=/tmp/unprivileged.tar
outputs: type=oci,dest=/tmp/unprivileged.tar
platforms: linux/amd64,linux/arm64
build-contexts: |
nginx-s3-gateway=docker-image://localhost:5000/nginx-s3-gateway:oss
Expand Down

0 comments on commit 4a022b2

Please sign in to comment.