2 changed files with 22 additions and 2 deletions
@ -1,7 +1,14 @@
|
||||
docker registry image |
||||
--------------------- |
||||
|
||||
Expose the port 5000 to be able to access it: |
||||
You need to create `/srv/registry` and `/srv/auth` folders and htpasswd file (using htpassword from apache2-utils package): |
||||
``` |
||||
docker run registry -p 5000:5000 |
||||
$ mkdir /srv/registry |
||||
$ mkdir /srv/auth |
||||
$ htpasswd -cB /srv/auth/htpasswd registry |
||||
``` |
||||
|
||||
Start the registry using docker compose (in the folder with the docker-compose.yml): |
||||
``` |
||||
$ docker-compose up -d |
||||
``` |
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
registry: |
||||
restart: always |
||||
image: localhost:5000/registry |
||||
ports: |
||||
- 5000:5000 |
||||
environment: |
||||
REGISTRY_AUTH: htpasswd |
||||
REGISTRY_AUTH_HTPASSWD_PATH: /etc/auth/htpasswd |
||||
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm |
||||
volumes: |
||||
- /srv/registry:/var/lib/docker-registry |
||||
- /srv/auth:/etc/auth |
Loading…
Reference in new issue