Skip to content

Commit

Permalink
Use numeric UID in container images
Browse files Browse the repository at this point in the history
A Kubernetes PodSecurityPolicy with runAsUser other than RunAsAny
validates the UID of the container before running it. When using the UID
of the image, a numeric ID is required there.

https://kubernetes.io/docs/concepts/policy/pod-security-policy/

Issue: #1559
  • Loading branch information
cbandy committed May 26, 2020
1 parent 2f36f25 commit bdc1166
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion centos7/Dockerfile.pgo-apiserver.centos7
Expand Up @@ -16,6 +16,6 @@ RUN yum -y install postgresql${PGVERSION} hostname && yum -y clean all
ADD bin/apiserver /usr/local/bin
ADD conf/postgres-operator /default-pgo-config

USER daemon
USER 2

ENTRYPOINT ["/usr/local/bin/apiserver"]
2 changes: 1 addition & 1 deletion centos7/Dockerfile.pgo-client.centos7
Expand Up @@ -20,6 +20,6 @@ ENV PGO_CLIENT_KEY=${PGO_CLIENT_KEY}

RUN chmod +x /usr/local/bin/pgo

USER daemon
USER 2

CMD tail -f /dev/null
2 changes: 1 addition & 1 deletion centos7/Dockerfile.pgo-event.centos7
Expand Up @@ -11,6 +11,6 @@ LABEL name="pgo-event" \

ADD bin/pgo-event /usr/local/bin

USER daemon
USER 2

ENTRYPOINT ["/usr/local/bin/pgo-event.sh"]
2 changes: 1 addition & 1 deletion centos7/Dockerfile.postgres-operator.centos7
Expand Up @@ -14,6 +14,6 @@ RUN yum -y install hostname postgresql${PGVERSION} && yum -y clean all
ADD bin/postgres-operator /usr/local/bin
ADD conf/postgres-operator /default-pgo-config

USER daemon
USER 2

ENTRYPOINT ["postgres-operator"]
2 changes: 1 addition & 1 deletion rhel7/Dockerfile.pgo-apiserver.rhel7
Expand Up @@ -18,6 +18,6 @@ RUN yum -y install \
ADD bin/apiserver /usr/local/bin
ADD conf/postgres-operator /default-pgo-config

USER daemon
USER 2

ENTRYPOINT ["/usr/local/bin/apiserver"]
2 changes: 1 addition & 1 deletion rhel7/Dockerfile.pgo-client.rhel7
Expand Up @@ -20,6 +20,6 @@ ENV PGO_CLIENT_KEY=${PGO_CLIENT_KEY}

RUN chmod +x /usr/local/bin/pgo

USER daemon
USER 2

CMD tail -f /dev/null
2 changes: 1 addition & 1 deletion rhel7/Dockerfile.pgo-event.rhel7
Expand Up @@ -11,6 +11,6 @@ LABEL name="pgo-event" \

ADD bin/pgo-event /usr/local/bin

USER daemon
USER 2

ENTRYPOINT ["/usr/local/bin/pgo-event.sh"]
2 changes: 1 addition & 1 deletion rhel7/Dockerfile.postgres-operator.rhel7
Expand Up @@ -17,6 +17,6 @@ RUN yum -y install \
ADD bin/postgres-operator /usr/local/bin
ADD conf/postgres-operator /default-pgo-config

USER daemon
USER 2

ENTRYPOINT ["postgres-operator"]

0 comments on commit bdc1166

Please sign in to comment.