Skip to content

Commit

Permalink
build arm64 distro images (#1264)
Browse files Browse the repository at this point in the history
* build arm64 distro images
  • Loading branch information
sgalsaleh authored Oct 1, 2024
1 parent 2a82756 commit 5a6d222
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/distros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,50 @@ concurrency:
cancel-in-progress: true

jobs:
list-distros:
runs-on: ubuntu-latest
outputs:
distros: ${{ steps.list-distros.outputs.distros }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: List distros
id: list-distros
run: |
cd dev/distros
distros=$(make list | jq -Rsc 'split("\n") | map(select(length > 0))')
echo "distros=$distros" >> $GITHUB_OUTPUT
build-and-push:
runs-on: ubuntu-latest
needs: list-distros
strategy:
fail-fast: false
matrix:
distro: ${{ fromJson(needs.list-distros.outputs.distros) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push
run: |
cd dev/distros
make list | xargs -I {} make build-and-push-{}
uses: docker/build-push-action@v6
with:
push: true
tags: |
replicated/ec-distro:${{ matrix.distro }}
platforms: linux/amd64,linux/arm64
file: dev/distros/dockerfiles/${{ matrix.distro }}.Dockerfile
context: dev/distros
5 changes: 0 additions & 5 deletions dev/distros/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ SHELL := /bin/bash
list:
@ls dockerfiles/*.Dockerfile | sed 's/^dockerfiles\///' | sed 's/\.Dockerfile$$//'

.PHONY: build-and-push-%
build-and-push-%:
@$(MAKE) build-$*
docker push replicated/ec-distro:$*

.PHONY: build-%
build-%:
docker build -t replicated/ec-distro:$* -f dockerfiles/$*.Dockerfile .

0 comments on commit 5a6d222

Please sign in to comment.