Skip to content

Commit 99bd557

Browse files
authored
Changes user to 1000 (#329)
* non-root 1000 user Signed-off-by: James Busche <jbusche@us.ibm.com> * cleanup dockerfile Signed-off-by: James Busche <jbusche@us.ibm.com> * moving curl into builder Signed-off-by: James Busche <jbusche@us.ibm.com> --------- Signed-off-by: James Busche <jbusche@us.ibm.com>
1 parent 970dd12 commit 99bd557

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

CONTROLLER_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.29.57
1+
1.29.58

Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,23 @@ COPY go.sum go.sum
88
COPY cmd cmd
99
COPY pkg pkg
1010
COPY hack hack
11+
COPY CONTROLLER_VERSION CONTROLLER_VERSION
1112

13+
RUN cd /workdir && curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
1214
RUN make mcad-controller
1315

1416
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
1517

1618
COPY --from=BUILDER /workdir/_output/bin/mcad-controller /usr/local/bin
19+
COPY --from=BUILDER /workdir/kubectl /usr/local/bin
1720

1821
RUN true \
1922
&& microdnf update \
20-
&& microdnf --nodocs install \
21-
curl shadow-utils \
2223
&& microdnf clean all \
2324
&& true
2425

25-
RUN cd /usr/local/bin && curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
26-
2726
WORKDIR /usr/local/bin
2827

29-
RUN groupadd --system --gid=9999 mcad && \
30-
useradd --system --create-home --uid=9999 --gid=mcad mcad
31-
32-
RUN chown -R mcad:mcad /usr/local/bin
28+
RUN chown -R 1000:1000 /usr/local/bin
3329

34-
USER mcad
30+
USER 1000

0 commit comments

Comments
 (0)