Run publisher container as user root

This commit is contained in:
Hans Gschossmann 2018-07-16 10:48:09 +02:00
Родитель 8a4f20f7b0
Коммит ed86d12b54
4 изменённых файлов: 0 добавлений и 17 удалений

Просмотреть файл

@ -17,11 +17,7 @@ RUN dotnet publish -c Release -o out
# start it up
FROM microsoft/dotnet:${runtime_base_tag} AS runtime
# Add an unprivileged user account for running the module
RUN adduser -s /bin/sh -D moduleuser
WORKDIR /app
COPY --from=build /app/opcpublisher/out ./
WORKDIR /appdata
RUN chown -R moduleuser /appdata
USER moduleuser
ENTRYPOINT ["dotnet", "/app/opcpublisher.dll"]

Просмотреть файл

@ -17,11 +17,7 @@ RUN dotnet publish -c Release -o out
# start it up
FROM microsoft/dotnet:${runtime_base_tag} AS runtime
# Add an unprivileged user account for running the module
RUN adduser -s /bin/sh -D moduleuser
WORKDIR /app
COPY --from=build /app/opcpublisher/out ./
WORKDIR /appdata
RUN chown -R moduleuser /appdata
USER moduleuser
ENTRYPOINT ["dotnet", "/app/opcpublisher.dll"]

Просмотреть файл

@ -22,14 +22,9 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends unzip procps && \
rm -rf /var/lib/apt/lists/*
# Add an unprivileged user account for running the module
RUN useradd -s /bin/sh moduleuser
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
WORKDIR /app
COPY --from=build /app/opcpublisher/out ./
WORKDIR /appdata
RUN chown -R moduleuser /appdata
USER moduleuser
ENTRYPOINT ["dotnet", "/app/opcpublisher.dll"]

Просмотреть файл

@ -17,11 +17,7 @@ RUN dotnet publish -c Release -o out
# start it up
FROM microsoft/dotnet:${runtime_base_tag} AS runtime
# Add an unprivileged user account for running the module
RUN useradd -s /bin/sh moduleuser
WORKDIR /app
COPY --from=build /app/opcpublisher/out ./
WORKDIR /appdata
RUN chown -R moduleuser /appdata
USER moduleuser
ENTRYPOINT ["dotnet", "/app/opcpublisher.dll"]