Skip to content

Commit 4892e51

Browse files
author
sophia parafina
committed
added docker compose section`
1 parent 28ca2a6 commit 4892e51

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed
-219 KB
Binary file not shown.

registry/images/moby.png

-5.29 KB
Binary file not shown.

registry/images/preferences.png

-61.3 KB
Binary file not shown.

registry/part-3.md

+26
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,32 @@ Status: Image is up to date for registry.local:5000/hello-world:latest
9292

9393
> Note. The open-source registry does not support the same authorization model as Docker Hub or Docker Trusted Registry. Once you are logged in to the registry, you can push and pull from any repository, there is no restriction to limit specific users to specific repositories.
9494
95+
## Using Docker Compose to Start the Registry
96+
Typing in all the options to start the registry can become tedious. An easier and simpler way is to use [Docker Compose](https://docs.docker.com/compose/). Here's an example of a `docker-compose.yml` file that will start the registry.
97+
```
98+
registry:
99+
restart: always
100+
image: registry:2
101+
ports:
102+
- 5000:5000
103+
environment:
104+
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
105+
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
106+
REGISTRY_AUTH: htpasswd
107+
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
108+
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
109+
volumes:
110+
- /path/registry-data:/var/lib/registry
111+
- /path/certs:/certs
112+
- /path/auth:/auth
113+
```
114+
115+
To start the registry, type:
116+
```
117+
$ sudo docker-compose up
118+
```
119+
120+
95121
## Conclusion
96122

97123
[Docker Registry](https://docs.docker.com/registry/) is a free, open-source application for storing and accessing Docker images. You can run the registry in a container on your own network, or in a virtual network in the cloud, to host private images with secure access. For Linux hosts, there is an [official registry image](https://hub.docker.com/_/registry/) on Docker Hub.

0 commit comments

Comments
 (0)