Add Local Registry Example

This commit is contained in:
Frank Woeckener
2025-03-28 08:21:34 +01:00
parent 7859ba370c
commit d8d1f2f63a
4 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
services:
registry:
image: registry:2.8.3
container_name: registry
restart: always
ports:
- "5000:5000"
environment:
REGISTRY_STORAGE_DELETE_ENABLED: "true"
volumes:
- registry-data:/var/lib/registry
volumes:
registry-data:
driver: local

3
00_registry/gc_registry.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker exec registry bin/registry garbage-collect /etc/docker/registry/config.yml

8
00_registry/show_images.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
if ! which jq >/dev/null ; then
echo "Please install jq first."
exit 1
fi
curl http://localhost:5000/v2/_catalog | jq .

View File

@@ -87,6 +87,13 @@ docker push username/mein-projekt:1.0
docker pull username/mein-projekt:1.0
```
Lokale Registry:
```bash
docker build -t localhost:5000/mein-projekt:1.0 .
docker push localhost:5000/mein-projekt:1.0
docker image ls localhost:5000/*
```
## Container-Lebenszyklus
### Starten, Stoppen, Löschen