Deploying and Managing Sonatype Nexus 3.0 Repository Manager using Nirmata
Nexus Repository Manager is a free, open source repository for storing and managing code artifacts in various formats including Docker container images. It is easy to use and has extensive capabilities such as access control, caching etc that are necessary for any DevOps toolchain.
Often when our customers start using containers, they need to select an image registry. Sometimes they end up using Docker Hub or Amazon ECR service but occasionally they want to use their own private image registry and Nexus proves to be a great option. In this post, I will demonstrate how to use the official Nexus docker image and deploy it using Nirmata.
On board your host/VM in to Nirmata. You can do this either using Direct Connect host or creating a cloud provider. Refer to our docs for more details.
Once the host is ‘connected’ in Nirmata, you can add a label to this host e.g. type = nexus. This will ensure that nexus containers are always deployed on this host.
On the host
Official nexus container, requires nexus user and group with ids 200 to be created so that the mounted host volumes can be written to.
$ sudo mkdir nexus-data
$ sudo chown nexus nexus-data
$ sudo chgrp nexus nexus-data
Now all you need to do is:
- Import the Nexus blueprint from the catalog
- Deploy the Nexus application into an environment
See this video for a short demo.
Once the container is deployed and running, you need to do the following to get up and running:
- Add users (Default login admin/admin123)
- Enable docker registry on port 5000 (http or https)
- Create a docker repository
Now you should be able to push images to this registry. Remember to use –insecure-registry docker setting if using http.
Also, check out our blog posts on: