compared with
Current by Erik Drolshammer
on Jul 08, 2015 15:30.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (7)

View Page History
h4. Install and configure Docker
Moved to [https://github.com/Cantara/maven-infrastructure/tree/master/nexus]

Install docker according to [docs|https://docs.docker.com/installation/ubuntulinux/]:
{code} -----
wget -qO- https://get.docker.com/ | sh
{code}


h4. Steps

Use a _data volume container_ for persistence.
Docker image is based on https://registry.hub.docker.com/u/sonatype/nexus/.



{code}
sudo mkdir /data
sudo docker build -t cantara/nexus
sudo docker create -v /data/nexus_home --name nexus-data cantara/nexus
sudo docker run -d -p 8081:8081 --name nexus20150708 --volumes-from nexus-data cantara/nexus
{code}

h6. Test

{code}
curl http://localhost:8081/service/local/status
{code}


h6. From sonatype/nexus
{code}
sudo mkdir /data
sudo docker create -v /data/nexus_home --name nexus-data sonatype/nexus
sudo docker pull sonatype/nexus
--sudo docker run -d --name nexus-data sonatype/nexus echo "data-only container for Nexus"--
sudo docker run -d -p 8081:8081 --name nexus20150527 --volumes-from nexus-data --restart=on-failure:10 sonatype/nexus
{code}

* *TODO* Evaluate how to restart nexus at boot.
** [https://docs.docker.com/articles/host_integration/]


* Follow the [Post-Install Checklist|http://books.sonatype.com/nexus-book/reference/install-sect-repoman-post-install.html]

h6. Explore

Check that you now have two containers. nexus-data container do not have to be running.
{code}
sudo docker ps -a
{code}


{code}
curl http://localhost:8081/service/local/status
{code}

http://stackoverflow.com/questions/23405689/accessing-a-docker-containers-file-system-through-terminal

{code}
sudo docker exec -t -i nexus /bin/bash
{code}

h6. Read more
* https://registry.hub.docker.com/u/sonatype/nexus/
* [Persistent volumes with Docker - Data-only container pattern|http://www.tech-d.net/2013/12/16/persistent-volumes-with-docker-container-as-volume-pattern/]