From 519daba29490333246b729d82952ab8c8b6b8e66 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 16 Feb 2024 07:40:22 +0000 Subject: [PATCH] Remove root user from Dockerfiles --- Accounts/Dockerfile.tpl | 1 - AdminDashboard/Dockerfile.tpl | 1 - App/Dockerfile.tpl | 1 - Dashboard/Dockerfile.tpl | 1 - Fluentd/Dockerfile.tpl | 5 ++++- Haraka/Dockerfile.tpl | 2 +- Ingestor/Dockerfile.tpl | 1 - Nginx/Dockerfile.tpl | 1 - Probe/Dockerfile.tpl | 1 - StatusPage/Dockerfile.tpl | 1 - TestServer/Dockerfile.tpl | 1 - Tests/Dockerfile.tpl | 1 - 12 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Accounts/Dockerfile.tpl b/Accounts/Dockerfile.tpl index d3850d9a5c..30a52b69a1 100644 --- a/Accounts/Dockerfile.tpl +++ b/Accounts/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/AdminDashboard/Dockerfile.tpl b/AdminDashboard/Dockerfile.tpl index df982df11a..8411cd0aa6 100644 --- a/AdminDashboard/Dockerfile.tpl +++ b/AdminDashboard/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/App/Dockerfile.tpl b/App/Dockerfile.tpl index aed81c687b..1ccb6606f0 100644 --- a/App/Dockerfile.tpl +++ b/App/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.2-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/Dashboard/Dockerfile.tpl b/Dashboard/Dockerfile.tpl index ca0f0400c6..5924c37e83 100644 --- a/Dashboard/Dockerfile.tpl +++ b/Dashboard/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/Fluentd/Dockerfile.tpl b/Fluentd/Dockerfile.tpl index 9fc011934e..3528c665e1 100644 --- a/Fluentd/Dockerfile.tpl +++ b/Fluentd/Dockerfile.tpl @@ -1,4 +1,7 @@ FROM fluentd + +# This container will only run in dev env, so this is ok. USER root + # Install bash and curl. -RUN apk add --update --no-cache bash curl \ No newline at end of file +RUN apk add bash curl \ No newline at end of file diff --git a/Haraka/Dockerfile.tpl b/Haraka/Dockerfile.tpl index af1623ce36..d4025ec660 100644 --- a/Haraka/Dockerfile.tpl +++ b/Haraka/Dockerfile.tpl @@ -1,5 +1,5 @@ FROM node:21.6-alpine3.18 -USER root + RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/Ingestor/Dockerfile.tpl b/Ingestor/Dockerfile.tpl index 4a7affbc5e..b1634981f2 100644 --- a/Ingestor/Dockerfile.tpl +++ b/Ingestor/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/Nginx/Dockerfile.tpl b/Nginx/Dockerfile.tpl index 28b46098ee..230495af55 100644 --- a/Nginx/Dockerfile.tpl +++ b/Nginx/Dockerfile.tpl @@ -1,6 +1,5 @@ FROM nginx:1.25.3-alpine -USER root ARG GIT_SHA ARG APP_VERSION diff --git a/Probe/Dockerfile.tpl b/Probe/Dockerfile.tpl index b27801a748..08e1576b07 100644 --- a/Probe/Dockerfile.tpl +++ b/Probe/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/StatusPage/Dockerfile.tpl b/StatusPage/Dockerfile.tpl index a97a8aec3b..c1277043e6 100644 --- a/StatusPage/Dockerfile.tpl +++ b/StatusPage/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/TestServer/Dockerfile.tpl b/TestServer/Dockerfile.tpl index 30de9b96ed..e7bc0e141c 100644 --- a/TestServer/Dockerfile.tpl +++ b/TestServer/Dockerfile.tpl @@ -4,7 +4,6 @@ # Pull base image nodejs image. FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global diff --git a/Tests/Dockerfile.tpl b/Tests/Dockerfile.tpl index d715c9984a..9c4fe025c4 100644 --- a/Tests/Dockerfile.tpl +++ b/Tests/Dockerfile.tpl @@ -1,5 +1,4 @@ FROM node:21.6-alpine3.18 -USER root RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global # Install bash.