Nexus as cache for Kubenetes Kind - Sonatype Nexus Repository / Best Practices - Sonatype Community

Nexus as cache for Kubenetes Kind

post by philipp-github on Dec 29, 2021

Hello,

I’m using in my local developing environment Kubernetes Kind with Java projects (dockerized services). We get often into rate limits of multiple Maven and Docker public repositories, so I would like to setup a mirror / cache for my local deployment. I have configured multiple docker registries in my Nexus and also Maven repositories.

Everything is working fine, so my docker daemon and Maven uses Nexus as mirror.

I have setup a Nexus docker container with a volume binding ./nexus-data:/nexus-data

So now I would like to build my fixed Nexus image based on this configuration, so I have created a Dockerfile and make a

COPY ./nexus-data /nexus-data

And than the service does not start, I have found out that the data is owned by the user and group “nexus”, so I try to make a chown for all files, but this does not work.

So at the moment my data under ./nexus-data is completely empty, I setup the blob storages but I don’t query any data, so my goal is to set-up a Nexus docker container with a given configuration for using in development (fixed proxy repositories, fixed groups, fixed cache policy, fixed authentication, etc).

How can I do this? Which files are needed to store the configuration and how can I copy this during the docker build into the nexus-data structure so it will work. The artifacts e.g. blob files should be mounted as external volumes in the container.

Thanks a lot for this help

post by philipp-github on Dec 30, 2021

It seems that the volume within the origin dockerfile docker-nexus3/Dockerfile at master · sonatype/docker-nexus3 · GitHub create this issue.