push registry v2

This commit is contained in:
Grégory Lebreton 2023-11-17 10:01:04 +01:00
commit 5c3455f1c2
3 changed files with 115 additions and 0 deletions

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# DOCKER REGISTRE AVEC UI
Ce projet a pour but d'instancier un registre Docker sécurisé par mot de passe et
accessible via une UI. Votre Docker Hub!
### CREATION D'UN PASSWORD:
Ici, remplacer testuser et testpassword par le nom d'utilisateur et le mot de passe désiré.
```sh
sudo apt-get install apache2-utils
htpasswd -Bbn testuser testpassword > registry-config/htpasswd
```
### LANCER LA STACK
```sh
docker-compose up -d
```
### SE CONNECTER A L'ADRESSE:
http://locahost:8087
### POUSSER UNE IMAGE:
Login au docker registry (nécessaire une fois):
```sh
docker login localhost:5000
```
Entrer l'utilisateur et le mot de passe créés plus tôt, puis:
```sh
docker tag localhost/mon_image:tag
docker push localhost/mon_image:tag
```

43
docker-compose.yml Normal file
View File

@ -0,0 +1,43 @@
version: '3.8'
services:
registry-ui:
image: joxit/docker-registry-ui:main
container_name: registry-ui
restart: always
ports:
- 8087:80
environment:
- SINGLE_REGISTRY=true
- REGISTRY_TITLE=Docker Registry UI
- DELETE_IMAGES=true
- SHOW_CONTENT_DIGEST=true
- NGINX_PROXY_PASS_URL=http://registry:5000
- SHOW_CATALOG_NB_TAGS=true
- CATALOG_MIN_BRANCHES=1
- CATALOG_MAX_BRANCHES=1
- TAGLIST_PAGE_SIZE=100
- REGISTRY_SECURED=false
- CATALOG_ELEMENTS_LIMIT=1000
networks:
- registry-ui-net
registry:
image: registry:2.8.2
container_name: registry
restart: always
environment:
REGISTRY_HTTP_HEADERS_Access-Control-Origin: '[http://registry.example.com]'
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Methods: '[HEAD,GET,OPTIONS,DELETE]'
REGISTRY_HTTP_HEADERS_Access-Control-Credentials: '[true]'
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Headers: '[Authorization,Accept,Cache-Control]'
REGISTRY_HTTP_HEADERS_Access-Control-Expose-Headers: '[Docker-Content-Digest]'
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
volumes:
- ./registry/data:/var/lib/registry
- ./registry-config:/etc/docker/registry
networks:
- registry-ui-net
networks:
registry-ui-net:

View File

@ -0,0 +1,39 @@
version: 0.1
log:
fields:
service: registry
storage:
delete:
enabled: true
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
Access-Control-Allow-Origin: ['http://127.0.0.1:8000']
Access-Control-Allow-Credentials: [true]
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']
Access-Control-Max-Age: [1728000]
Access-Control-Allow-Credentials: [true]
Access-Control-Expose-Headers: ['Docker-Content-Digest']
auth:
htpasswd:
realm: basic-realm
path: /etc/docker/registry/htpasswd
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3