Last active
January 13, 2023 14:32
-
-
Save alirezazadeh77/07ce4a3761a6d0dd5f1c4a8bcaefc471 to your computer and use it in GitHub Desktop.
set up docker registry and clear data unuse layer script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker exec -it docker-registry-registry_server-1 registry garbage-collect -m /etc/docker/registry/config.yml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.1 | |
log: | |
fields: | |
service: registry | |
storage: | |
delete: | |
enabled: true | |
cache: | |
blobdescriptor: inmemory | |
filesystem: | |
rootdirectory: /data | |
http: | |
addr: :5000 | |
headers: | |
X-Content-Type-Options: [nosniff] | |
Access-Control-Allow-Origin: ['*'] | |
Access-Control-Allow-Credentials: [ true ] | |
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE'] | |
Access-Control-Expose-Headers: ['Docker-Content-Digest'] | |
health: | |
storagedriver: | |
enabled: true | |
interval: 10s | |
threshold: 3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
registry_server: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
environment: | |
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data | |
REGISTRY_STORAGE_DELETE_ENABLED: 'yes' | |
volumes: | |
- ../registry_data:/data | |
- ./config.yml:/etc/docker/registry/config.yml | |
ui: | |
image: joxit/docker-registry-ui:1.5-static | |
ports: | |
- 8080:80 | |
environment: | |
- REGISTRY_TITLE=My Private Docker Registry | |
- REGISTRY_URL=http://registry_server:5000 | |
- DELETE_IMAGES=true | |
depends_on: | |
- registry_server | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment