Tag Archives: docker; docker-compose

Docker even has a public registry called Docker Hub to store Docker images. While Docker lets you upload your Docker creations to their Docker Hub for free, anything you upload is also public. This might not be the best option when you work on your projects or inside your organization.

So I wanted to spin up my own private docker registry based on … docker. Actually docker-compose as I need to components for my repo: the docker server itself and the nginx server acting as a proxy to handle authentication and ssl.

Below the docker-compose.yml file I’m using to spin up the environment:

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

nginx:

image:"nginx:1.9"

ports:

-5443:443

links:

-registry:registry

volumes:

-./nginx/:/etc/nginx/conf.d:ro

registry:

image:registry:2

ports:

-127.0.0.1:5000:5000

environment:

REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY:/data

volumes:

-./data:/data

On my host I created two directories to handle data images and nginx configuration.

Shell

1

2

3

4

5

6

7

iulian@iulitab:/usr/share/docker-registry$ls-la

total20

drwxr-xr-x4root root4096Mar2014:49.

drwxr-xr-x125root root4096Mar421:20..

drwxr-xr-x3iulian iulian4096Mar2015:16data

-rw-r--r--1iulian iulian296Mar2014:32docker-compose.yml

drwxr-xr-x2iulian iulian4096Mar2014:47nginx

In nginx directory I added the configuration file nginx.conf together with the ssl certificate.