Skip to content

Nexus Installation Guide - Docker

Install and configure Docker

Install lxc-docker according to docs.

Steps

Use a data volume container for persistence.

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 nexus --volumes-from nexus-data --restart=on-failure:10 sonatype/nexus
Explore

Check that you now have two containers. nexus-data container do not have to be running.

sudo docker ps -a

curl http://localhost:8081/service/local/status

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

sudo docker exec -t -i nexus /bin/bash
Read more

Apache reverse proxy

sudo a2enmod headers
<VirtualHost *:80>
       ServerName someIpHere
       Redirect / https://someIpHere/
</VirtualHost>

<VirtualHost *:443>
        ServerName someIpHere
        RequestHeader set X-Forwarded-Proto "https"

        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/some.no.crt
        SSLCertificateKeyFile /etc/apache2/ssl/some.no.key

        ProxyPass /jenkins http://localhost:8080/jenkins nocanon
        ProxyPassReverse /jenkins http://localhost:8080/jenkins
        ProxyRequests     Off
        AllowEncodedSlashes NoDecode
        #Doc: https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache

        #books.sonatype.com/nexus-book/reference/install-sect-proxy.html
        ProxyPass /nexus/ http://localhost:8081/
        ProxyPassReverse /nexus/ http://localhost:8081/
        ProxyPassReverseCookiePath / /nexus
</VirtualHost>