From f96911ed57cf2b775b409ff2b4593ab8902f8634 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 23 Mar 2018 22:16:57 -0400 Subject: [PATCH] Revert "running as bitwarden user" This reverts commit 19fa9bf8063f1d986b30d2c55370fcdd96febc21. --- src/Admin/Dockerfile | 8 ++------ src/Api/Dockerfile | 11 ++--------- src/Icons/Dockerfile | 7 +------ src/Icons/entrypoint.sh | 2 +- src/Identity/Dockerfile | 8 ++------ util/Attachments/Dockerfile | 6 +----- util/MsSql/Dockerfile | 12 ++---------- util/Nginx/Dockerfile | 10 +--------- util/Server/Dockerfile | 3 +-- util/Setup/Dockerfile | 5 ++--- 10 files changed, 15 insertions(+), 57 deletions(-) diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile index 8a83d521db..57da39a4e0 100644 --- a/src/Admin/Dockerfile +++ b/src/Admin/Dockerfile @@ -1,17 +1,13 @@ FROM microsoft/aspnetcore:2.0.5 -USER root RUN groupadd -g 999 bitwarden && \ useradd -r -u 999 -g bitwarden bitwarden - USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish . + COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index a1ac1a658c..7238300b1d 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -1,6 +1,5 @@ FROM microsoft/aspnetcore:2.0.5 -USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ cron \ @@ -8,23 +7,17 @@ RUN apt-get update \ RUN groupadd -g 999 bitwarden && \ useradd -r -u 999 -g bitwarden bitwarden - USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish/Api . -COPY obj/Docker/publish/Jobs /jobs -USER root +COPY obj/Docker/publish/Jobs /jobs RUN mv /jobs/crontab /etc/cron.d/bitwarden-cron \ && chmod 0644 /etc/cron.d/bitwarden-cron \ && touch /var/log/cron.log -USER bitwarden COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile index 705f84d63c..9085b4f474 100644 --- a/src/Icons/Dockerfile +++ b/src/Icons/Dockerfile @@ -1,6 +1,5 @@ FROM microsoft/aspnetcore:2.0.5 -USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ unzip \ @@ -8,8 +7,8 @@ RUN apt-get update \ 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 \ @@ -22,9 +21,5 @@ EXPOSE 80 COPY obj/Docker/publish . COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/src/Icons/entrypoint.sh b/src/Icons/entrypoint.sh index 31c44c0614..6e716551ba 100644 --- a/src/Icons/entrypoint.sh +++ b/src/Icons/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/sh -/iconserver/iconserver & +/etc/iconserver/iconserver & dotnet /app/Icons.dll iconsSettings:bestIconBaseUrl=http://localhost:8080 diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile index 8a83d521db..57da39a4e0 100644 --- a/src/Identity/Dockerfile +++ b/src/Identity/Dockerfile @@ -1,17 +1,13 @@ FROM microsoft/aspnetcore:2.0.5 -USER root RUN groupadd -g 999 bitwarden && \ useradd -r -u 999 -g bitwarden bitwarden - USER bitwarden + WORKDIR /app EXPOSE 80 COPY obj/Docker/publish . + COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/Attachments/Dockerfile b/util/Attachments/Dockerfile index eec51825c4..e8879368c9 100644 --- a/util/Attachments/Dockerfile +++ b/util/Attachments/Dockerfile @@ -1,11 +1,7 @@ FROM bitwarden/server -USER bitwarden EXPOSE 80 + COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/MsSql/Dockerfile b/util/MsSql/Dockerfile index d45bbb7490..c6c9d0db81 100644 --- a/util/MsSql/Dockerfile +++ b/util/MsSql/Dockerfile @@ -1,26 +1,18 @@ FROM microsoft/mssql-server-linux:2017-CU4 -USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ cron \ && rm -rf /var/lib/apt/lists/* -RUN groupadd -g 999 bitwarden && \ - useradd -r -u 999 -g bitwarden bitwarden - COPY crontab /etc/cron.d/bitwarden-cron RUN chmod 0644 /etc/cron.d/bitwarden-cron \ && touch /var/log/cron.log -USER bitwarden COPY backup-db.sql / COPY backup-db.sh / -COPY entrypoint.sh / - -USER root RUN chmod +x /backup-db.sh -RUN chmod +x /entrypoint.sh -USER bitwarden +COPY entrypoint.sh / +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/Nginx/Dockerfile b/util/Nginx/Dockerfile index ce37e28bd5..dbde5ebcf7 100644 --- a/util/Nginx/Dockerfile +++ b/util/Nginx/Dockerfile @@ -1,17 +1,9 @@ FROM nginx:1.12 -USER root -RUN groupadd -g 999 bitwarden && \ - useradd -r -u 999 -g bitwarden bitwarden - -USER bitwarden COPY nginx.conf /etc/nginx COPY proxy.conf /etc/nginx COPY mime.types /etc/nginx + COPY entrypoint.sh / - -USER root RUN chmod +x /entrypoint.sh - -USER bitwarden ENTRYPOINT ["/entrypoint.sh"] diff --git a/util/Server/Dockerfile b/util/Server/Dockerfile index 49774362dc..dfa84babd1 100644 --- a/util/Server/Dockerfile +++ b/util/Server/Dockerfile @@ -1,8 +1,7 @@ FROM microsoft/aspnetcore:2.0.5 -USER root 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 85132b040f..d780a514bd 100644 --- a/util/Setup/Dockerfile +++ b/util/Setup/Dockerfile @@ -1,14 +1,13 @@ FROM microsoft/dotnet:2.0.5-runtime -USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ openssl \ - && rm -rf /var/lib/apt/lists/* +&& 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 .