1

Anyone had any experience setting this up? Https needs to be enabled in the sonatype/nexus3 config but the files are read only. How can this be edited without having to do a docker build using the nexus3 image? Can i login as root inside the container?

Steve Fitzsimons
  • 3,754
  • 7
  • 27
  • 66

3 Answers3

3

One of our internal people here at Sonatype created a Docker image that helps with this:

https://hub.docker.com/r/bradbeck/nexus-https/~/dockerfile/

This might help grease the skids for you. Of note this is not supported by Sonatype, but by Brad himself. Using this Dockerfile as your base would be good, as it will likely be fairly close to our supported one.

You'd likely modify this to expose a few more ports for the Docker registries you want to create. Thoughts are an internal hosted registry, a proxy of the hub, and then a group of the two for ease of access.

Run through most of the work here as well: https://books.sonatype.com/nexus-book/reference3/docker.html

DarthHater
  • 3,222
  • 25
  • 26
0

$ docker run -d -p 8081:8081 Have you mapped the port with host and docker container.

You can login in container as

           ```docker exec -it $container_id /bin/bash```
Manoj Sahu
  • 2,774
  • 20
  • 18
  • Yep I've mapped 8081 and can log into the nexus UI and configure a docker hub proxy and a hosted docker repo. Ive set up the required https ports and mapped them to the exposed docker ports i.e. exposed 61100:61100. – Steve Fitzsimons Dec 08 '16 at 14:32
  • I also have logged onto it but without root access i cannot modify any configuration files to enable https (required for hosting docker repos) – Steve Fitzsimons Dec 08 '16 at 14:33
  • A docker container always run with root user. Do you know where are the config file in the container, If you know than you can do a volume map to that path using -v and put your config their. It will replace internal file. – Manoj Sahu Dec 09 '16 at 14:01
0

You can try to use my solution, which actually doesn't modify sonatype/nexus3 original image, but instead use nginx-proxy (with ssl support) in front of nexus3 itself. In short it uses docker-compose to make nexus3+nginx work out of the box with one click. And at the same time I also have some API calls to make configuration changes during nexus3 deployment, you can extend them with your custom ones.

Sergey
  • 211
  • 1
  • 4