Skip to content

Commit

Permalink
Update image builds (#814)
Browse files Browse the repository at this point in the history
- Use non-root user
- Remove custom image argument, as dependabot doesn't understand it *1
- Remove redunant CI arg *2

*1 This was previously done to avoid using chiseled images locally as
doing so caused the VS container debugging to die after not finding
`tail`. This has been fixed in 17.10 Preview 2 and should be released
soon microsoft/DockerTools#409

*2 This was done to not generate MissionProgressionInfo in CI but this
condition was removed from the project file in #746
  • Loading branch information
SapiensAnatis authored May 19, 2024
1 parent e8034d8 commit 59ac377
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ jobs:
context: .
push: true
file: ${{ inputs.dockerfile }}
build-args: |
CI=true
BASE_DOTNET_IMAGE=mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled
tags: ghcr.io/sapiensanatis/${{ inputs.image-name }}:${{ steps.derive-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
12 changes: 3 additions & 9 deletions DragaliaAPI/DragaliaAPI/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
ARG BASE_DOTNET_IMAGE=mcr.microsoft.com/dotnet/aspnet:8.0.3

FROM $BASE_DOTNET_IMAGE AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/aspnet:8.0.3-jammy-chiseled AS base
USER app
EXPOSE 8080
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0.203 AS build

ARG CI

WORKDIR /src
COPY ["DragaliaAPI/DragaliaAPI.MissionDesigner/DragaliaAPI.MissionDesigner.csproj", "DragaliaAPI/DragaliaAPI.MissionDesigner/"]
COPY ["DragaliaAPI/DragaliaAPI.MasterAssetConverter/DragaliaAPI.MasterAssetConverter.csproj", "DragaliaAPI/DragaliaAPI.MasterAssetConverter/"]
Expand All @@ -26,6 +21,5 @@ WORKDIR "/src/DragaliaAPI/DragaliaAPI"
RUN dotnet publish "DragaliaAPI.csproj" -c Release -o /app/publish/ /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=build /app/publish/ .
ENTRYPOINT ["dotnet", "DragaliaAPI.dll"]
9 changes: 3 additions & 6 deletions PhotonStateManager/DragaliaAPI.Photon.StateManager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ARG BASE_DOTNET_IMAGE=mcr.microsoft.com/dotnet/aspnet:8.0.3

FROM $BASE_DOTNET_IMAGE AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/aspnet:8.0.3-jammy-chiseled AS base
USER app
EXPOSE 8080
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0.203 AS build
WORKDIR /src
Expand All @@ -19,6 +17,5 @@ WORKDIR "/src/PhotonStateManager/DragaliaAPI.Photon.StateManager"
RUN dotnet publish "DragaliaAPI.Photon.StateManager.csproj" -c Release -o /app/publish/ /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=build /app/publish/ .
ENTRYPOINT ["dotnet", "DragaliaAPI.Photon.StateManager.dll"]

0 comments on commit 59ac377

Please sign in to comment.