Build arm32 docker image

This commit is contained in:
Genteure 2021-06-17 23:41:41 +08:00
parent 898c206938
commit 104874d19e
4 changed files with 17 additions and 5 deletions

View File

@ -127,13 +127,16 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build CLI
run: dotnet build -c Release -o ./BililiveRecorder.Cli/bin/docker_out BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile.GitHubActions
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -147,13 +147,16 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build CLI
run: dotnet build -c Release -o ./BililiveRecorder.Cli/bin/docker_out BililiveRecorder.Cli/BililiveRecorder.Cli.csproj
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile.GitHubActions
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,10 +1,10 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
COPY . /src
RUN cd /src/BililiveRecorder.Cli && dotnet build -o /output -c Release
FROM mcr.microsoft.com/dotnet/runtime:5.0
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine
COPY --from=0 /output /app
VOLUME [ "/rec" ]
WORKDIR /app
ENTRYPOINT [ "/app/BililiveRecorder.Cli" ]
CMD [ "-h" ]
CMD [ "-h" ]

6
Dockerfile.GitHubActions Normal file
View File

@ -0,0 +1,6 @@
FROM mcr.microsoft.com/dotnet/runtime:5.0
COPY ./BililiveRecorder.Cli/bin/docker_out /app
VOLUME [ "/rec" ]
WORKDIR /app
ENTRYPOINT [ "dotnet", "/app/BililiveRecorder.Cli.dll" ]
CMD [ "-h" ]