Skip to content

Commit

Permalink
Support for mixed image packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
cookieY committed Apr 24, 2023
1 parent d23f1d0 commit 794f331
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
31 changes: 6 additions & 25 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ on:
workflow_dispatch:

env:
BASEIMAGES: '3.17'
# YEARNING_VER: '3.0.0-rc11'
# YEARNING_URL: 'https://github.com/cookieY/Yearning/releases/download/v3.0.0-rc11/Yearning-3.0.0-rc11-linux-amd64.zip'
BASEIMAGES: '3.17.3'

jobs:
push_to_registries:
Expand Down Expand Up @@ -36,7 +34,7 @@ jobs:
uses: docker/metadata-action@v3
with:
images: |
chaiyd/yearning
yeelabs/yearning
- name: Set up Docker Buildx
id: buildx
Expand All @@ -49,39 +47,22 @@ jobs:
with:
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
builder: ${{ steps.buildx.outputs.name }}
push: true
build-args: |
BASEIMAGES=${{ env.BASEIMAGES }}
LINUX_PLA=amd64
YEARNING_VER=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
tags: |
chaiyd/yearning:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}-amd64
chaiyd/yearning
yeelabs/yearning:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
yeelabs/yearning
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker images arm
uses: docker/build-push-action@v2
with:
context: ./docker
file: ./docker/Dockerfile
platforms: linux/arm64
builder: ${{ steps.buildx.outputs.name }}
push: true
build-args: |
BASEIMAGES=${{ env.BASEIMAGES }}
LINUX_PLA=arm64
YEARNING_VER=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
tags: |
chaiyd/yearning:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}-arm64
labels: ${{ steps.meta.outputs.labels }}

- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
uses: anchore/scan-action@v3
id: scan
with:
image: chaiyd/yearning:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}-amd64
image: yeelabs/yearning:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
acs-report-enable: true
fail-build: false

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASEIMAGES=3.17
FROM alpine:${BASEIMAGES} AS builder

LABEL maintainer="chaiyd <chaiyd.cn@gmail.com>"
LABEL maintainer="chaiyd <chaiyd.cn@gmail.com>,henryyee <henry@yearning.io>"

ARG YEARNING_VER=v3.1.4

Expand Down

0 comments on commit 794f331

Please sign in to comment.