Skip to content

Commit 5df56cc

Browse files
Migrate container publishing to GHCR with multi-arch support (#25)
* Migrate container publishing to GHCR with multi-arch support * Add RuntimeIdentifiers for multi-arch container builds * Specify single RID for Docker validation build in CI
1 parent 849cd90 commit 5df56cc

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/pr_validation.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,16 @@ jobs:
115115
with:
116116
global-json-file: "./global.json"
117117

118+
- name: "Set up Docker"
119+
uses: docker/setup-docker-action@v4
120+
with:
121+
daemon-config: |
122+
{
123+
"debug": true,
124+
"features": {
125+
"containerd-snapshotter": true
126+
}
127+
}
128+
118129
- name: "Build Container Image"
119130
run: dotnet publish src/SkillServer/SkillServer.csproj -c Release /t:PublishContainer

.github/workflows/publish_container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
-c Release \
5151
/t:PublishContainer \
5252
/p:ContainerRegistry=${{ env.REGISTRY }} \
53-
/p:ContainerRepository=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} \
53+
/p:ContainerRepository=${{ env.IMAGE_NAME }} \
5454
/p:ContainerRuntimeIdentifier=${{ matrix.rid }} \
5555
/p:ContainerImageTags='"${{ github.ref_name }}-${{ matrix.arch }}"'
5656

src/SkillServer/SkillServer.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
<RootNamespace>SkillServer</RootNamespace>
66
<AssemblyName>SkillServer</AssemblyName>
77
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
8-
<ContainerRepository>skillserver</ContainerRepository>
8+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
9+
<ContainerRepository>netclaw-dev/skillserver</ContainerRepository>
910
<ContainerTitle>skillserver</ContainerTitle>
11+
<ContainerImageTags>$(VersionPrefix);latest</ContainerImageTags>
12+
<ContainerRuntimeIdentifiers>linux-x64;linux-arm64</ContainerRuntimeIdentifiers>
13+
<RuntimeIdentifiers>linux-x64;linux-arm64</RuntimeIdentifiers>
1014
</PropertyGroup>
1115

1216
<ItemGroup>

0 commit comments

Comments
 (0)