Skip to content

Commit

Permalink
Merge pull request freifunk-gluon#2976 from herbetom/github-container…
Browse files Browse the repository at this point in the history
…-registry-multiplattform

workflows: build-container: build images for amd64 and arm64
  • Loading branch information
blocktrron authored Dec 4, 2023
2 parents 1a0aa71 + 0358344 commit 34ceff6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: gluon-build
IMAGE_NAME: ${{ github.repository }}-build

jobs:
build-and-push-image:
Expand All @@ -21,6 +21,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
if: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }}
Expand All @@ -32,11 +36,12 @@ jobs:
id: meta
uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3
with:
images: ${{ env.REGISTRY }}/freifunk-gluon/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: ./contrib/docker
push: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
9 changes: 6 additions & 3 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM debian:bookworm-slim

ARG TARGETOS
ARG TARGETARCH

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
Expand Down Expand Up @@ -27,9 +30,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /tmp/ec &&\
wget -O /tmp/ec/ec-linux-amd64.tar.gz https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.7.0/ec-linux-amd64.tar.gz &&\
tar -xvzf /tmp/ec/ec-linux-amd64.tar.gz &&\
mv bin/ec-linux-amd64 /usr/local/bin/editorconfig-checker &&\
wget -O /tmp/ec/ec-${TARGETOS}-${TARGETARCH}.tar.gz https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.7.0/ec-${TARGETOS}-${TARGETARCH}.tar.gz &&\
tar -xvzf /tmp/ec/ec-${TARGETOS}-${TARGETARCH}.tar.gz &&\
mv bin/ec-${TARGETOS}-${TARGETARCH} /usr/local/bin/editorconfig-checker &&\
rm -rf /tmp/ec

RUN useradd -m -d /gluon -u 100 -g 100 -o gluon
Expand Down

0 comments on commit 34ceff6

Please sign in to comment.