-
Notifications
You must be signed in to change notification settings - Fork 0
Setup Docker Distribution Setup
Docker Distribution is the https://github.com/docker/distribution What is Docker Distribution
Nexus is default enterprise repos and is meant to support Docker containers (as a proxy). Well we tried and it was a time-consuming and ultimately unproductive experience. Whilst a set up was found that it was possible to create a configuration that worked without SSL, without SSL is really a deal breaker.
Additionally, the nexus option was: Expensive to run requiring 8Gb with 4 CPU cores Much more difficult to configure through scripts, although we didn't get to that since; Were unable to practically get it working in a reasonable timeframe.
- Create a docker VM. Can be very lightweight
- Create a user account
- Create self signed certificates.
- C
ufw allow 443 useradd machine mkdir /home/machine chown machine /home/machine usermod -aG docker machine su - machine mkdir registry mkdir certs
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/ssl/private/apache.key -out /etc/ssl/certs/apache.crt
docker run -d \ --restart=always \ --name registry \ -v "$(pwd)"/certs:/certs \ -v /home/machine/registry:/var/lib/registry \ -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/apache.crt \ -e REGISTRY_HTTP_TLS_KEY=/certs/apache.key \ -p 443:443 \ registry:2
Then run a smoke test: `` docker pull localhost/hello-world docker tag hello-world localhost/hello docker push localhost/hello
``
To test the configuration, a demonstration instance was stood up and a CDN proxy was used to provide terminating SSL so that only self signed keys were required internally.
`` $ docker run docker.repo.com/hello
Hello from Docker! This message shows that your installation appears to be working correctly. ``