Skip to content

Commit

Permalink
Arm package test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaaaabor committed Apr 4, 2024
1 parent 0bb0c71 commit 20c7ca6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/publish-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Build image
run: docker build . --file ./examples/DockerExample/Dockerfile --tag $IMAGE_NAME

- name: Build arm image
run: docker build . --file ./examples/DockerExample/Dockerfile --tag ${{ IMAGE_NAME }}_arm --build-arg BASE_IMAGE=mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim-arm32v7 --build-arg BUILD_IMAGE=mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

Expand All @@ -40,4 +43,20 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push arm image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/${{ $IMAGE_NAME }}_arm
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
7 changes: 5 additions & 2 deletions examples/DockerExample/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
ARG BASE_IMAGE = mcr.microsoft.com/dotnet/aspnet:8.0
ARG BUILD_IMAGE = mcr.microsoft.com/dotnet/sdk:8.0

FROM $BASE_IMAGE AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM $BUILD_IMAGE AS build

WORKDIR /src

Expand Down

0 comments on commit 20c7ca6

Please sign in to comment.