Skip to content
Snippets Groups Projects
Unverified Commit 34ceff69 authored by David Bauer's avatar David Bauer Committed by GitHub
Browse files

Merge pull request #2976 from herbetom/github-container-registry-multiplattform

workflows: build-container: build images for amd64 and arm64
parents 1a0aa715 03583444
No related branches found
Tags experimental-2023-12-05-base
No related merge requests found
...@@ -12,7 +12,7 @@ on: ...@@ -12,7 +12,7 @@ on:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: gluon-build IMAGE_NAME: ${{ github.repository }}-build
jobs: jobs:
build-and-push-image: build-and-push-image:
...@@ -21,6 +21,10 @@ jobs: ...@@ -21,6 +21,10 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 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 - name: Log in to the Container registry
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
if: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }} if: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }}
...@@ -32,11 +36,12 @@ jobs: ...@@ -32,11 +36,12 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3 uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3
with: with:
images: ${{ env.REGISTRY }}/freifunk-gluon/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with: with:
context: ./contrib/docker context: ./contrib/docker
push: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }} push: ${{ github.repository_owner == 'freifunk-gluon' && github.event_name == 'push' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
FROM debian:bookworm-slim FROM debian:bookworm-slim
ARG TARGETOS
ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
...@@ -27,9 +30,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -27,9 +30,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/ec &&\ 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 &&\ 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-linux-amd64.tar.gz &&\ tar -xvzf /tmp/ec/ec-${TARGETOS}-${TARGETARCH}.tar.gz &&\
mv bin/ec-linux-amd64 /usr/local/bin/editorconfig-checker &&\ mv bin/ec-${TARGETOS}-${TARGETARCH} /usr/local/bin/editorconfig-checker &&\
rm -rf /tmp/ec rm -rf /tmp/ec
RUN useradd -m -d /gluon -u 100 -g 100 -o gluon RUN useradd -m -d /gluon -u 100 -g 100 -o gluon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment