mirror of
https://github.com/g3rv4/GetMoarFediverse.git
synced 2024-11-21 23:23:09 +01:00
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:
|
build-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
architecture: [ amd64, arm64v8 ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build things
|
- name: Build things
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
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:
|
create-docker-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ create-release ]
|
needs: [ create-release ]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
architecture: [ amd64, arm64v8 ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -92,6 +95,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$version = '${{ github.event.ref }}'.Replace('refs/tags/', '').Replace('v', '')
|
$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:latest
|
||||||
docker push "ghcr.io/g3rv4/getmoarfediverse:$version"
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# 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
|
WORKDIR /src
|
||||||
COPY src /src/
|
COPY src /src/
|
||||||
RUN dotnet publish -c Release /src/GetMoarFediverse.csproj -o /app
|
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"]
|
VOLUME ["/data"]
|
||||||
ENV CONFIG_PATH=/data/config.json
|
ENV CONFIG_PATH=/data/config.json
|
||||||
COPY --from=builder /app /app
|
COPY --from=builder /app /app
|
||||||
|
Loading…
Reference in New Issue
Block a user