Skip to content

Commit

Permalink
remove user docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cherchyk committed Feb 12, 2024
1 parent 1c567dc commit 968448a
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Service.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,17 @@ RUN dotnet publish "./Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p
#########################################################################

FROM mcr.microsoft.com/dotnet/aspnet:$RUN_IMAGE_TAG AS base
##########################
# RUN adduser -D app
# USER app
##########################
# Non-root user that will run the service
ARG USER=km
RUN \
# Create user
#Debian: useradd --create-home --user-group $USER --shell /bin/bash && \
adduser -D -h /app -s /bin/sh $USER && \
# Allow user to access the build
chown -R $USER.$USER /app
# Define current user
USER $USER
##########################
# ARG USER=km
# RUN \
# # Create user
# #Debian: useradd --create-home --user-group $USER --shell /bin/bash && \
# adduser -D -h /app -s /bin/sh $USER && \
# # Allow user to access the build
# chown -R $USER.$USER /app
# # Define current user
# USER $USER

WORKDIR /app
EXPOSE 8080
EXPOSE 8081
Expand Down

0 comments on commit 968448a

Please sign in to comment.