Updated github actions to include QEMU/buildx to build multiarch containers
This commit is contained in:
parent
f1ba022c62
commit
70e9dc9811
2 changed files with 20 additions and 13 deletions
27
.github/workflows/package.yaml
vendored
27
.github/workflows/package.yaml
vendored
|
|
@ -43,15 +43,16 @@ jobs:
|
||||||
python setup.py bdist_wheel
|
python setup.py bdist_wheel
|
||||||
cp dist/*.whl docker/root
|
cp dist/*.whl docker/root
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
- name: Docker Setup Buildx
|
- name: Docker Setup Buildx
|
||||||
uses: docker/setup-buildx-action@v2.0.0
|
uses: docker/setup-buildx-action@v2.0.0
|
||||||
with:
|
|
||||||
use: true
|
|
||||||
driver-opts: |
|
|
||||||
platforms=amd64,arm64
|
|
||||||
|
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: docker buildx --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
|
run: docker buildx build --platform=linux/amd64,linux/arm64 --cache-to=type=local,dest=/tmp/build-cache --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
|
||||||
|
|
||||||
- name: login to GitHub Container Registry
|
- name: login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
|
@ -60,9 +61,10 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Push image on master or release
|
- name: Build preparations
|
||||||
|
if: ${{ github.ref }} =~ ^refs\/heads\/master|^refs\/tags\/v.*
|
||||||
|
id: preperations
|
||||||
run: |
|
run: |
|
||||||
if [[ ${{ github.ref }} =~ ^refs\/heads\/master|^refs\/tags\/v.* ]]; then
|
|
||||||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
|
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
|
||||||
|
|
||||||
# Change all uppercase to lowercase
|
# Change all uppercase to lowercase
|
||||||
|
|
@ -75,9 +77,10 @@ jobs:
|
||||||
[ "$VERSION" == "master" ] && VERSION=latest
|
[ "$VERSION" == "master" ] && VERSION=latest
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
echo VERSION=$VERSION
|
echo VERSION=$VERSION
|
||||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
echo "::set-output name=IMAGE_TAG::$(
|
||||||
docker push $IMAGE_ID:$VERSION
|
echo $IMAGE_ID:$VERSION
|
||||||
else
|
)"
|
||||||
echo "Skipped on PRs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
- name: Build Docker Image and push to registry
|
||||||
|
if: ${{ github.ref }} =~ ^refs\/heads\/master|^refs\/tags\/v.*
|
||||||
|
run: docker buildx build --push --platform=linux/amd64,linux/arm64 --cache-from=type=local,src=/tmp/build-cache --tag ${{ steps.preperations.outputs.IMAGE_TAG }} --label "runnumber=${GITHUB_RUN_ID}" docker/
|
||||||
|
|
@ -15,7 +15,11 @@ RUN apk update --no-cache && \
|
||||||
py3-pip && \
|
py3-pip && \
|
||||||
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/main/ \
|
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/main/ \
|
||||||
python3=~3.10 \
|
python3=~3.10 \
|
||||||
py3-setuptools && \
|
py3-setuptools \
|
||||||
|
zlib-dev \
|
||||||
|
jpeg-dev \
|
||||||
|
python3-dev \
|
||||||
|
libwebp-dev && \
|
||||||
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/community/ \
|
apk add --repository=http://dl-3.alpinelinux.org/alpine/edge/community/ \
|
||||||
py3-pip && \
|
py3-pip && \
|
||||||
mkdir -p /config && \
|
mkdir -p /config && \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue