This will be a small introduction series to the world of Docker.
I’ll be going over the following topics:
I had applied for the GitHub Student Developer Pack. I had $150 in credits for AWS. 😎
I decided to put this to good use. I have started exploring Amazon EC2, Amazon Elastic Beanstalk, Amazon EC2 Container Service. The aws-cli is really pretty awesome with the little use that I have done so far. As I go, I will keep updating this repo aws-scripts with the scripts I prepare. As this is just my testing with aws-cli scripts, these scripts will be hard coded and in general may not be usable anywhere else without a little tweaking.
I will keep blogging about my adventure, all my successes and failures as well.
So, we all have used Docker Hub and it’s private repositories, but sometimes, if we want to do some testing on the local network and want to save some bandwidth, we could set up our own Docker Registry. If you want to read that documentation that’s fine. But this is to just get you running.
The machine on which you want to configure the registry(Let’s call it the server) must have a static IP. Add an entry to your
/etc/hosts file (Linux or MAC). Then follow these steps (Run these on the server only.)
mkdir -p certs && openssl req \ -newkey rsa:4096 -nodes -sha256 -keyout certs/docker.key \ -x509 -days 365 -out certs/docker.crt
Then, run this command. (Obviously you have docker installed and configured for your user! You’re not that dumb. 😉 )
docker run -d -p 5000:5000 --restart=always --name registry \
-v `pwd`/data:/var/lib/registry \
-v `pwd`/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/docker.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/docker.key \
You are almost done! Just two more steps left to configure your docker engine to talk to this registry. (These must be done on your local machines)
- Copy the
docker.crt file to
- Restart Docker Engine. (
systemctl restart docker)