From 8f036c765af2ceec58c0ff3d86d760845a716784 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Mon, 10 Aug 2020 10:23:03 +0000 Subject: [PATCH] chore(images): install shadow package in base images The latest `photon:2.0` does not include `groupadd` and `useradd` we need to install `shadow` package which includes these commands. Signed-off-by: He Weiwei --- make/photon/clair-adapter/Dockerfile.base | 4 +++- make/photon/core/Dockerfile.base | 2 +- make/photon/jobservice/Dockerfile.base | 2 +- make/photon/nginx/Dockerfile.base | 2 +- make/photon/notary-server/Dockerfile.base | 2 +- make/photon/notary-signer/Dockerfile.base | 2 +- make/photon/portal/Dockerfile.base | 6 +++--- make/photon/registry/Dockerfile.base | 4 +++- make/photon/registryctl/Dockerfile.base | 4 +++- make/photon/trivy-adapter/Dockerfile.base | 2 +- 10 files changed, 18 insertions(+), 12 deletions(-) diff --git a/make/photon/clair-adapter/Dockerfile.base b/make/photon/clair-adapter/Dockerfile.base index fb44c3014..154fddfc8 100644 --- a/make/photon/clair-adapter/Dockerfile.base +++ b/make/photon/clair-adapter/Dockerfile.base @@ -1,5 +1,7 @@ FROM photon:2.0 -RUN mkdir /clair-adapter/ \ +RUN tdnf install -y shadow >> /dev/null \ + && tdnf clean all \ + && mkdir /clair-adapter/ \ && groupadd -r -g 10000 clair-adapter \ && useradd --no-log-init -m -r -g 10000 -u 10000 clair-adapter \ No newline at end of file diff --git a/make/photon/core/Dockerfile.base b/make/photon/core/Dockerfile.base index 636392879..dd1a383a1 100644 --- a/make/photon/core/Dockerfile.base +++ b/make/photon/core/Dockerfile.base @@ -1,6 +1,6 @@ FROM photon:2.0 -RUN tdnf install tzdata -y >> /dev/null \ +RUN tdnf install -y tzdata shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor \ && mkdir /harbor/ diff --git a/make/photon/jobservice/Dockerfile.base b/make/photon/jobservice/Dockerfile.base index 0d1b4bc51..a51f56ba8 100644 --- a/make/photon/jobservice/Dockerfile.base +++ b/make/photon/jobservice/Dockerfile.base @@ -1,5 +1,5 @@ FROM photon:2.0 -RUN tdnf install tzdata -y >> /dev/null \ +RUN tdnf install -y tzdata shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 harbor && useradd --no-log-init -r -m -g 10000 -u 10000 harbor diff --git a/make/photon/nginx/Dockerfile.base b/make/photon/nginx/Dockerfile.base index b56ddf9ae..4980c7dd5 100644 --- a/make/photon/nginx/Dockerfile.base +++ b/make/photon/nginx/Dockerfile.base @@ -1,6 +1,6 @@ FROM photon:2.0 -RUN tdnf install nginx -y >> /dev/null\ +RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \ && ln -sf /dev/stdout /var/log/nginx/access.log \ diff --git a/make/photon/notary-server/Dockerfile.base b/make/photon/notary-server/Dockerfile.base index 5ba92765a..d74e49389 100644 --- a/make/photon/notary-server/Dockerfile.base +++ b/make/photon/notary-server/Dockerfile.base @@ -1,6 +1,6 @@ FROM photon:2.0 -RUN tdnf install -y shadow \ +RUN tdnf install -y shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 notary \ && useradd --no-log-init -r -g 10000 -u 10000 notary diff --git a/make/photon/notary-signer/Dockerfile.base b/make/photon/notary-signer/Dockerfile.base index 5ba92765a..d74e49389 100644 --- a/make/photon/notary-signer/Dockerfile.base +++ b/make/photon/notary-signer/Dockerfile.base @@ -1,6 +1,6 @@ FROM photon:2.0 -RUN tdnf install -y shadow \ +RUN tdnf install -y shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 notary \ && useradd --no-log-init -r -g 10000 -u 10000 notary diff --git a/make/photon/portal/Dockerfile.base b/make/photon/portal/Dockerfile.base index 330c64f52..9566c3832 100644 --- a/make/photon/portal/Dockerfile.base +++ b/make/photon/portal/Dockerfile.base @@ -1,8 +1,8 @@ FROM photon:2.0 -RUN tdnf install -y nginx >> /dev/null \ +RUN tdnf install -y nginx shadow >> /dev/null \ + && tdnf clean all \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \ - && chown -R nginx:nginx /etc/nginx \ - && tdnf clean all \ No newline at end of file + && chown -R nginx:nginx /etc/nginx \ No newline at end of file diff --git a/make/photon/registry/Dockerfile.base b/make/photon/registry/Dockerfile.base index e237eb5ae..b0a9e590c 100644 --- a/make/photon/registry/Dockerfile.base +++ b/make/photon/registry/Dockerfile.base @@ -1,4 +1,6 @@ FROM photon:2.0 -RUN mkdir -p /etc/registry \ +RUN tdnf install -y shadow >> /dev/null \ + && tdnf clean all \ + && mkdir -p /etc/registry \ && groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor \ No newline at end of file diff --git a/make/photon/registryctl/Dockerfile.base b/make/photon/registryctl/Dockerfile.base index 9affefff1..e09ece073 100644 --- a/make/photon/registryctl/Dockerfile.base +++ b/make/photon/registryctl/Dockerfile.base @@ -1,4 +1,6 @@ FROM photon:2.0 -RUN groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor \ +RUN tdnf install -y shadow >> /dev/null \ + && tdnf clean all \ + && groupadd -r -g 10000 harbor && useradd --no-log-init -m -g 10000 -u 10000 harbor \ && mkdir -p /etc/registry diff --git a/make/photon/trivy-adapter/Dockerfile.base b/make/photon/trivy-adapter/Dockerfile.base index 223ce2d74..52cc63de0 100644 --- a/make/photon/trivy-adapter/Dockerfile.base +++ b/make/photon/trivy-adapter/Dockerfile.base @@ -1,6 +1,6 @@ FROM photon:2.0 -RUN tdnf install -y rpm >> /dev/null \ +RUN tdnf install -y rpm shadow >> /dev/null \ && tdnf clean all \ && groupadd -r -g 10000 scanner \ && useradd --no-log-init -m -r -g 10000 -u 10000 scanner