-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish multi-arch container images (#101)
* Multi-arch publish This PR introduces a PR, to build & publish ARM64 & AMD64 container images to quay.io/cloud-bulldozer/netperf Signed-off-by: Krishna Harsha Voora <[email protected]> * Bifurcate the GitHub Actions * Updates the container image flow * Trigger only when Dockerfile changes --------- Signed-off-by: Krishna Harsha Voora <[email protected]>
- Loading branch information
Showing
2 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Release k8s-netperf container image | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'containers/Dockerfile' # Trigger only when Dockerfile changes in a pull request | ||
|
||
env: | ||
CONTAINER_REGISTRY: ${{ github.repository_owner == 'cloud-bulldozer' && 'quay.io' }} | ||
RHEL_VERSION: ubi9 | ||
GO_VER: 1.19 | ||
|
||
jobs: | ||
|
||
build-and-push-container-images: | ||
name: Build and Push Container Images | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup docker-buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
buildkitd-flags: --debug | ||
config-inline: | | ||
[worker.oci] | ||
max-parallelism = 1 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to the ${{ env.CONTAINER_REGISTRY }} Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.CONTAINER_REGISTRY }} | ||
username: ${{ env.CONTAINER_REGISTRY == 'quay.io' && secrets.QUAY_IO_USERNAME || github.actor }} | ||
password: ${{ env.CONTAINER_REGISTRY == 'quay.io' && secrets.QUAY_IO_TOKEN || secrets.GITHUB_TOKEN } | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.CONTAINER_REGISTRY }}/${{ github.repository_owner }}/netperf | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
- name: Build and push multi-arch Image | ||
id: push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: containers/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
RHEL_VERSION=${{ env.RHEL_VERSION }} | ||
GO_VER=${{ env.GO_VER }} | ||
GO_TAGS= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters