travelaudience / docker-nexus

A container image for Sonatype Nexus Repository Manager OSS, based on Alpine Linux.
Apache License 2.0
43 stars 43 forks source link

Update Dockerfile #63

Open namloc2001 opened 3 years ago

namloc2001 commented 3 years ago

Make container run as nonroot and ensure compatibility with K8s PSPs and OpenShift restricted SCC.

removed:

ENV NEXUS_DATA_CHOWN "false"
...
...
# Copy runnable script
COPY run /etc/service/nexus/run
...
...
CMD ["/sbin/runsvdir", "-P", "/etc/service"]

Because this is all now achieved within the container image configuration. The default user for running the container image nexus and there the command to be used can now be /opt/sonatype/nexus/bin/nexus run.

(Move details on OpenShift compatibility can be found here: https://developers.redhat.com/blog/2020/10/26/adapting-docker-and-kubernetes-containers-to-run-on-red-hat-openshift-container-platform#)