-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use native ARM builders for container builds
This commit replaces #1088 and attempts to build a lading multi-platform image by use of organization provided ARM native builders. Unsure if this'll work but I figure it's worth a shot. Signed-off-by: Brian L. Troutwine <[email protected]>
- Loading branch information
Showing
2 changed files
with
56 additions
and
8 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 |
---|---|---|
|
@@ -8,8 +8,15 @@ env: | |
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
container: | ||
runs-on: ubuntu-20.04 | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- arch: amd64 | ||
runner: ubuntu-20.04 | ||
- arch: arm64 | ||
runner: arm-4core-linux-ubuntu24.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
@@ -47,9 +54,50 @@ jobs: | |
with: | ||
file: Dockerfile | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/${{ matrix.arch }} | ||
tags: | | ||
${{ steps.meta.outputs.tags }} | ||
${{ steps.meta.outputs.tags }}-${{ matrix.arch }} | ||
push: true | ||
platforms: linux/amd64, linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha, scope=${{ github.workflow }} | ||
cache-to: type=gha, scope=${{ github.workflow }} | ||
cache-from: type=registry,ref=ghcr.io/datadog/lading:latest | ||
cache-to: type=registry,ref=ghcr.io/datadog/lading:latest,mode=max | ||
|
||
manifest: | ||
name: Create Multi-Arch Manifest | ||
needs: build | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Log in to Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Extract Docker Metadata | ||
uses: docker/[email protected] | ||
id: meta | ||
with: | ||
tags: | | ||
type=sha,format=long | ||
type=ref,prefix=pr-,event=pr | ||
type=semver,pattern={{version}},event=tag | ||
type=semver,pattern={{major}}.{{minor}},event=tag | ||
type=semver,pattern={{major}},event=tag | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Create and Push Multi-Arch Manifest | ||
run: | | ||
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }} \ | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}-amd64 \ | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}-arm64 | ||
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.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