Skip to content

Commit

Permalink
feat(Docker): Enabled support for Linux ARM based Docker images (Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
seriouz committed May 21, 2024
1 parent 0b484cc commit 9823ff9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set release version
run: echo "PackageVersion=${{ needs.version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
bagetter/bagetter:latest
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ARG Version=1.0.0

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
ARG Version
ARG TARGETARCH
WORKDIR /src

## Create separate layer for `dotnet restore` to allow for caching; useful for local development
Expand All @@ -12,7 +13,7 @@ RUN for file in $(ls *.csproj); do mkdir -p ${file%.*}/ && mv $file ${file%.*}/;
# useful for debugging to display all files
#RUN echo $(ls)
# restore packages
RUN dotnet restore BaGetter/BaGetter.csproj
RUN dotnet restore BaGetter/BaGetter.csproj --arch $TARGETARCH

## Publish app (implicitly builds the app)
FROM build AS publish
Expand All @@ -27,7 +28,8 @@ RUN dotnet publish BaGetter \
-p DebugType=none \
-p DebugSymbols=false \
-p GenerateDocumentationFile=false \
-p UseAppHost=false
-p UseAppHost=false \
-a $TARGETARCH

# create default folders
RUN mkdir -p "/data/packages" \
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For more information, please refer to the [documentation].
## 📦 Features

* **Cross-platform**: runs on Windows, macOS, and Linux!
* **ARM** (64bit) **support**. You can host your NuGets on a device like Raspberry Pi!
* **Cloud native**: supports [Docker][Docker doc link], [AWS][AWS doc link], [Google Cloud][GCP doc link], [Alibaba Cloud][Aliyun doc link]
* **Offline support**: [Mirror a NuGet server][Read through caching] to speed up builds and enable offline downloads

Expand Down

0 comments on commit 9823ff9

Please sign in to comment.