Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TECH-30764 Update dockerfile to run image with non-root user #13

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions samples/MyCRM.Lodgement.Sample/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ RUN dotnet publish \


FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS final

RUN groupadd -r appgroup && useradd -r -g appgroup appuser

WORKDIR /app
COPY --from=build /app/publish .

LABEL org.opencontainers.image.source=https://github.com/loanmarket/mycrm-lodgement-sample

# Create a user
RUN chown -R appuser:appgroup /app
# Switch to the non-root user
USER appuser

ENTRYPOINT ["dotnet", "MyCRM.Lodgement.Sample.dll"]
Loading