Created
November 30, 2022 10:55
-
-
Save abdurrahman/c0ac66aeedefe5a692a28d4ff0965912 to your computer and use it in GitHub Desktop.
How to install tool internally with non-root user Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/sdk:6.0.300-bullseye-slim | |
ENV EF_VERSION=7.0.0 | |
ENV user dotnetuser | |
ENV PATH=/opt/bin:${PATH} | |
RUN dotnet tool install dotnet-ef --tool-path /opt/bin --version ${EF_VERSION} | |
WORKDIR /src | |
COPY ["./YourApplicationFolder", "."] | |
RUN adduser --disabled-password \ | |
--home /src \ | |
--gecos '' ${user} && chown -R ${user} /src | |
HEALTHCHECK NONE | |
USER ${user} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment