forked from extern/GetMoarFediverse
Create an ARM docker image as well (#29)
This commit is contained in:
parent
92e34f7086
commit
6431c9505f
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -23,10 +23,17 @@ jobs:
|
||||
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [ amd64, arm64v8 ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Build things
|
||||
shell: pwsh
|
||||
run: |
|
||||
docker build .
|
||||
if ('${{ matrix.architecture }}' -eq 'arm64v8') {
|
||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
}
|
||||
docker build . --build-arg ARCH=${{ matrix.architecture }}
|
||||
|
18
.github/workflows/create-release.yml
vendored
18
.github/workflows/create-release.yml
vendored
@ -78,6 +78,9 @@ jobs:
|
||||
create-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ create-release ]
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [ amd64, arm64v8 ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@ -92,6 +95,17 @@ jobs:
|
||||
run: |
|
||||
$version = '${{ github.event.ref }}'.Replace('refs/tags/', '').Replace('v', '')
|
||||
|
||||
docker build . --tag ghcr.io/g3rv4/getmoarfediverse:latest --tag "ghcr.io/g3rv4/getmoarfediverse:$version"
|
||||
if ('${{ matrix.architecture }}' -eq 'arm64v8') {
|
||||
sudo apt-get install qemu binfmt-support qemu-user-static
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
}
|
||||
|
||||
docker build . -t ghcr.io/g3rv4/getmoarfediverse:latest-${{ matrix.architecture }} --build-arg ARCH=${{ matrix.architecture }}
|
||||
docker tag ghcr.io/g3rv4/getmoarfediverse:latest-${{ matrix.architecture }} ghcr.io/g3rv4/getmoarfediverse:$version-${{ matrix.architecture }}
|
||||
docker push ghcr.io/g3rv4/getmoarfediverse:latest-${{ matrix.architecture }}
|
||||
docker push ghcr.io/g3rv4/getmoarfediverse:$version-${{ matrix.architecture }}
|
||||
|
||||
if ('${{ matrix.architecture }}' -eq 'amd64') {
|
||||
docker tag ghcr.io/g3rv4/getmoarfediverse:latest-${{ matrix.architecture }} ghcr.io/g3rv4/getmoarfediverse:latest
|
||||
docker push ghcr.io/g3rv4/getmoarfediverse:latest
|
||||
docker push "ghcr.io/g3rv4/getmoarfediverse:$version"
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0.403-alpine3.16 AS builder
|
||||
ARG ARCH=
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0.404-alpine3.16-${ARCH} AS builder
|
||||
WORKDIR /src
|
||||
COPY src /src/
|
||||
RUN dotnet publish -c Release /src/GetMoarFediverse.csproj -o /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0.11-alpine3.16
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0.12-alpine3.16-${ARCH}
|
||||
VOLUME ["/data"]
|
||||
ENV CONFIG_PATH=/data/config.json
|
||||
COPY --from=builder /app /app
|
||||
|
Loading…
Reference in New Issue
Block a user