Skip to content

Commit

Permalink
feature(multiarch): Push a multiarch OCI image
Browse files Browse the repository at this point in the history
  • Loading branch information
g0blin79 committed Oct 3, 2024
1 parent 950f636 commit e8a0603
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,40 @@ jobs:
with:
dockerfile: ./Dockerfile
config: .hadolint.yaml
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set tag
id: vars
run: echo "TAG=$(cat ./Dockerfile | grep com.bmeme.project.version | awk -F\' '{print $2}')" >> $GITHUB_OUTPUT
-
name: Build image
id: build
run: |
{
TAG=$(cat Dockerfile | grep com.bmeme.project.version | awk -F\' '{print $2}');\
\
docker build \
-t ${{ env.registry }}/${{ env.repository }}:${TAG} \
-t ${{ env.registry }}/${{ env.repository }}:latest \
-f ./Dockerfile .
}
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: false
platforms: "linux/arm64,linux/amd64"
tags: |
${{ env.registry }}/${{ env.repository }}:${{ steps.vars.outputs.tag }}
${{ env.registry }}/${{ env.repository }}:latest
# -
# name: Build image
# id: build
# run: |
# {
# TAG=$(cat Dockerfile | grep com.bmeme.project.version | awk -F\' '{print $2}');\
# \
# docker build \
# -t ${{ env.registry }}/${{ env.repository }}:${TAG} \
# -t ${{ env.registry }}/${{ env.repository }}:latest \
# -f ./Dockerfile .
# }
-
name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
Expand Down

0 comments on commit e8a0603

Please sign in to comment.