feat: multiarch image (#31)

This commit is contained in:
Paramtamtam
2023-01-23 00:24:45 +04:00
committed by GitHub
parent 40678de18c
commit 597d6e28ec
5 changed files with 38 additions and 52 deletions

View File

@@ -9,22 +9,20 @@ jobs:
name: Build docker image
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: gacts/github-slug@v1
id: slug
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to default Container Registry
uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -33,8 +31,8 @@ jobs:
- uses: docker/build-push-action@v3 # Action page: <https://github.com/docker/build-push-action>
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/ppc64le
tags: |
tarampampam/3proxy:${{ steps.slug.outputs.version-semantic }}
tarampampam/3proxy:latest

View File

@@ -18,26 +18,17 @@ jobs: # Docs: <https://git.io/JvxXE>
- uses: actions/checkout@v3
with: {fetch-depth: 0}
- name: Check for GitLeaks
uses: gacts/gitleaks@v1 # Action page: <https://github.com/gacts/gitleaks>
- uses: gacts/gitleaks@v1
build-image:
name: Build docker image
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Build docker image
run: docker build -f ./Dockerfile --tag 3proxy:local .
- name: Scan image
uses: anchore/scan-action@v3 # action page: <https://github.com/anchore/scan-action>
with:
image: 3proxy:local
fail-build: true
severity-cutoff: low # negligible, low, medium, high or critical
- name: Save docker image
run: docker save 3proxy:local > ./docker-image.tar
@@ -48,28 +39,6 @@ jobs: # Docs: <https://git.io/JvxXE>
path: ./docker-image.tar
retention-days: 1
scan-image:
name: Scan docker image
runs-on: ubuntu-20.04
needs: [build-image]
steps:
- name: Download built docker image
uses: actions/download-artifact@v3
with:
name: docker-image
path: .artifact
- name: Prepare image to run
working-directory: .artifact
run: docker load < docker-image.tar
- name: Scan image
uses: anchore/scan-action@v3 # action page: <https://github.com/anchore/scan-action>
with:
image: 3proxy:local
fail-build: true
severity-cutoff: low # negligible, low, medium, high or critical
try-to-use:
name: Build and use docker image (auth ${{ matrix.auth }})
runs-on: ubuntu-20.04