Skip to content

Commit

Permalink
Change USER from alphabatic to numeric
Browse files Browse the repository at this point in the history
Looks like when you run these image on microshift then pod is not
starting and failing with following error.
```
 message: 'container has runAsNonRoot and image has non-numeric user (redis),
          cannot verify user is non-root (pod: "microshift-python-pod_default(dd67b958-f807-47cb-ab7a-9f4f022f2658)",
          container: redis-podified)'
        reason: CreateContainerConfigError
```

This PR should fix that and container can run with podman and openshift
environment.
  • Loading branch information
praveenkumar authored and benoitf committed Oct 12, 2023
1 parent 98a341e commit e2231b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion primary-podify-demo/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ FROM scratch
COPY --from=ubi-builder /mnt/rootfs/ /
# Create redis user
RUN groupadd -g 1000 redis && useradd -u 1000 -g redis -G root redis
USER redis
USER 1000
# start the database as entrypoint
ENTRYPOINT ["/usr/local/bin/redis-server", "/etc/redis.conf"]
2 changes: 1 addition & 1 deletion primary-podify-demo/front/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ COPY --from=python-builder / /
# expose frontend port
EXPOSE 5000

USER frontend
USER 1000

WORKDIR /app

Expand Down

0 comments on commit e2231b8

Please sign in to comment.