From e499087a571c4927c1937af2920b06e74ec38b3b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 23 Mar 2018 21:17:37 -0400 Subject: [PATCH] run as bitwarden group/user --- src/Admin/Dockerfile | 4 ++++ src/Api/Dockerfile | 4 ++++ src/Icons/Dockerfile | 4 ++++ src/Identity/Dockerfile | 4 ++++ util/Server/Dockerfile | 5 +++++ util/Setup/Dockerfile | 4 ++++ 6 files changed, 25 insertions(+) diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile index 914d81be57..57da39a4e0 100644 --- a/src/Admin/Dockerfile +++ b/src/Admin/Dockerfile @@ -1,5 +1,9 @@ FROM microsoft/aspnetcore:2.0.5 +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish . diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index 24aeab0973..7238300b1d 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -5,6 +5,10 @@ RUN apt-get update \ cron \ && rm -rf /var/lib/apt/lists/* +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish/Api . diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile index cc484bb4ea..9085b4f474 100644 --- a/src/Icons/Dockerfile +++ b/src/Icons/Dockerfile @@ -5,6 +5,10 @@ RUN apt-get update \ unzip \ && rm -rf /var/lib/apt/lists/* +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + WORKDIR /tmp COPY iconserver.sha256 . RUN curl -L -o iconserver.zip https://github.com/mat/besticon/releases/download/v3.6.0/iconserver_linux_amd64.zip \ diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile index 914d81be57..57da39a4e0 100644 --- a/src/Identity/Dockerfile +++ b/src/Identity/Dockerfile @@ -1,5 +1,9 @@ FROM microsoft/aspnetcore:2.0.5 +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish . diff --git a/util/Server/Dockerfile b/util/Server/Dockerfile index ae5f57cc39..dfa84babd1 100644 --- a/util/Server/Dockerfile +++ b/util/Server/Dockerfile @@ -1,2 +1,7 @@ FROM microsoft/aspnetcore:2.0.5 + +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + COPY obj/Docker/publish /bitwarden_server diff --git a/util/Setup/Dockerfile b/util/Setup/Dockerfile index 4b95e2c74a..d780a514bd 100644 --- a/util/Setup/Dockerfile +++ b/util/Setup/Dockerfile @@ -5,5 +5,9 @@ RUN apt-get update \ openssl \ && rm -rf /var/lib/apt/lists/* +RUN groupadd -g 999 bitwarden && \ + useradd -r -u 999 -g bitwarden bitwarden +USER bitwarden + WORKDIR /app COPY obj/Docker/publish .