|
1 | | -# Traefik example |
| 1 | +# Single URL Docker Registry UI for Docker Swarm |
2 | 2 |
|
3 | | -Host the docker registry ui behind [traefik](http://traefik.io) with Docker Swarm mode. |
| 3 | +Swarm-compliant UI with public registry PULLs and authenticated registry PUSHes with Traefik v3. |
4 | 4 |
|
5 | | -## How to run |
| 5 | +## Features |
6 | 6 |
|
7 | | -Open a terminal console and type |
| 7 | +* Unauthenticated PULLs |
| 8 | +* Authenticated PUSH/DELETEs |
| 9 | +* Single URL (registry and ui on the same domain) |
| 10 | +* Let's Encrypt enabled |
| 11 | +* Authenticated Traefik Dashboard |
8 | 12 |
|
9 | | -```bash |
10 | | -bash run-swarm.sh |
| 13 | +## Introduction |
| 14 | + |
| 15 | +This configuration is designed to be a "single-serving" quickstart for homelab or development environment. |
| 16 | +It is built to be modular enough to easily break apart for larger or more production environments for the |
| 17 | +more advanced scenarios. |
| 18 | + |
| 19 | +It serves both a container registry and Joxit's Docker-Registry-UI on the same URL over HTTPS that can be |
| 20 | +secured with certificates from Let's Encrypt. The registry allows for public PULLs and authenticated PUSHes. |
| 21 | + |
| 22 | +Additionally, the **traefik** dashboard UI is published (although you do not need it during production) on |
| 23 | +port 8443 because [traefik hardcodes](https://doc.traefik.io/traefik/operations/api/#dashboard) the paths |
| 24 | +`/dashboard` and `/api`, plus it is just good practice to logically separate your administrative endpoints. |
| 25 | + |
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +### `.env` File |
| 29 | + |
| 30 | +The `.env` file makes it easy to perform all the replacements necessary. |
| 31 | + |
| 32 | +[!TIP] |
| 33 | +You may opt to find and replace the variables in the yaml file rather than relying on environment variables. |
| 34 | + |
| 35 | +```shell |
| 36 | +DOMAIN=contoso.com |
| 37 | +# Leave blank if not using Let's Encrypt |
| 38 | +RESOLVER=letsencrypt |
| 39 | +# Email address for Let's Encrypt |
| 40 | + |
11 | 41 | ``` |
12 | 42 |
|
13 | | -## Authentication |
| 43 | +## Uppies |
| 44 | + |
| 45 | +```shell |
| 46 | +❯ docker stack deploy -c swarm.yml registry |
| 47 | +Creating network registry_frontend |
| 48 | +Creating service registry_traefik |
| 49 | +Creating service registry_redis |
| 50 | +Creating service registry_registry |
| 51 | +Creating service registry_ui |
| 52 | +Creating service registry_error-pages |
| 53 | +``` |
| 54 | + |
| 55 | +### Accounts |
| 56 | + |
| 57 | +#### dashboard |
| 58 | + |
| 59 | +Traefik's dashboard account is: |
| 60 | + |
| 61 | +* Username: `admin` |
| 62 | +* Password: `hunter2` |
| 63 | + |
| 64 | +#### registry |
14 | 65 |
|
15 | | -The registry is protected via __Basic authentication__ but feel free to use whatever you like. |
16 | | -In this sample, credentials are: **admin / admin**. |
| 66 | +The registry account is: |
17 | 67 |
|
18 | | -To generate a new password for basic auth, run the command: `htpasswd -nb username password`. |
| 68 | +* Username: `user` |
| 69 | +* Password: `hunter2` |
19 | 70 |
|
20 | 71 | ## Contributors |
21 | 72 |
|
22 | | -Thank you [@onizet](https://github.com/onizet) for this example. |
| 73 | +* [@jnovack](https://github.com/jnovack) |
| 74 | +* [@agahkarakuzu](https://github.com/agahkarakuzu) |
| 75 | +* [@onizet](https://github.com/onizet) |
0 commit comments