Goal: Simplify installation and configuration of Nexus artifact repository.
See https://registry.hub.docker.com/u/sonatype/nexus/ for tips, most of it is applicable to this fork as well.
https://docs.docker.com/installation/ubuntulinux/
wget -qO- https://get.docker.com/ | sh
sudo docker pull cantara/nexus
sudo docker create -v /sonatype-work --name nexus-data cantara/nexus
sudo docker run -d -p 80:8081 --volumes-from nexus-data --name nexus20150708 cantara/nexus
curl http://localhost:80/service/local/status
Nexus container must be running. Copy everything inside /path/to/hostdir/ into /sonatype-work/storage/ in container (which is a mounted data volume container). Change owner to nexus. Verify that everything looks like expected.
cd /path/to/hostdir
tar -cv * | sudo docker exec -i nexus20150714 tar x -C /sonatype-work/storage/
sudo docker exec -i nexus20150714 chown nexus:nexus -R /sonatype-work/storage/
sudo docker exec -it nexus20150714 ls -la /sonatype-work/storage
See https://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes
sudo docker build -t cantara/nexus .
sudo docker create -v /sonatype-work --name nexus-data cantara/nexus
sudo docker run -d -p 8081:8081 --name nexus20150714 --volumes-from nexus-data cantara/nexus
sudo docker stop $(sudo docker ps -a -q) && sudo docker rm $(sudo docker ps -a -q)
sudo docker ps -a
sudo docker exec -it containerIdHere bash
Content type
Image
Digest
sha256:8a1b88704…
Size
292.9 MB
Last updated
almost 6 years ago
docker pull cantara/nexus