Docker image for nexus3 repository manager with composer plugin.
Visit the tutorial Guide to use instructions
docker build -t getjv/nexus3 . to build image.docker volume create --name nexus-data to create a volumedocker-compose up -d to run the server (taks ~2min to server wake up)docker exec -it --user=root nexus bash to access the container as root userdocker logs -f nexus to see nexus logshttp://localhost:8081/ to access nexus when using regular dockerhttp://192.168.99.100:8081/ to access nexus when using dockertoolbox (win7)docker exec nexus cat /nexus-data/admin.password to get admin passwordJust add this infor in your composer.json project
{
...
,
"config": {
"secure-http":false
},
"repositories": [
{
"type": "composer",
"url": "http://localhost:8081/repository/composer-proxy/"
},
{
"packagist.org": false
}
]
...
}
Our system requirements should be taken into account when provisioning the Docker container.
Default user is admin and the uniquely generated password can be found in the admin.password file inside the volume. See Persistent Data for information about the volume.
It can take some time (2-3 minutes) for the service to launch in a new container. You can tail the log to determine once Nexus is ready:
$ docker logs -f nexus
Installation of Nexus is to /opt/sonatype/nexus.
A persistent directory, /nexus-data, is used for configuration, logs, and storage. This directory needs to be writable by the Nexus process, which runs as UID 200.
There is an environment variable that is being used to pass JVM arguments to the startup script
INSTALL4J_ADD_VM_PARAMS, passed to the Install4J startup script. Defaults to -Xms1200m -Xmx1200m -XX:MaxDirectMemorySize=2g -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs.
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2g -Xmx2g -XX:MaxDirectMemorySize=3g -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
Of particular note, -Djava.util.prefs.userRoot=/some-other-dir can be set to a persistent path, which will maintain the installed Nexus Repository License if the container is restarted.
This can be supplied at runtime: $ docker run -d -p 8081:8081 --name nexus -e NEXUS_CONTEXT=nexus sonatype/nexus3
Content type
Image
Digest
Size
259.8 MB
Last updated
almost 7 years ago
docker pull getjv/nexus3-composer