Skip to content

Commit

Permalink
Non root container implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbres committed Dec 8, 2024
1 parent d423de3 commit 7f7d957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/UptimeKumaRemoteProbe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
RUN apt-get update && apt-get install -y --no-install-recommends \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN chmod u+s /bin/ping
USER $APP_UID
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
Expand Down
5 changes: 5 additions & 0 deletions src/UptimeKumaRemoteProbe/Dockerfile.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
&& dotnet publish "src/UptimeKumaRemoteProbe/UptimeKumaRemoteProbe.csproj" -c Release -o /app/publish -r $RID --self-contained false

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
RUN apt-get update && apt-get install -y --no-install-recommends \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN chmod u+s /bin/ping
USER $APP_UID
WORKDIR /app
COPY --from=build /app/publish .

Expand Down

0 comments on commit 7f7d957

Please sign in to comment.