init
This commit is contained in:
commit
883f31932e
169 changed files with 5676 additions and 0 deletions
13
ansible/roles/docker_registry/templates/config.yml.j2
Normal file
13
ansible/roles/docker_registry/templates/config.yml.j2
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
version: 0.1
|
||||
log:
|
||||
fields:
|
||||
service: registry
|
||||
storage:
|
||||
filesystem:
|
||||
rootdirectory: /var/lib/registry
|
||||
delete:
|
||||
enabled: true
|
||||
http:
|
||||
addr: :5000
|
||||
proxy:
|
||||
remoteurl: {{ remote_url | default('https://registry-1.docker.io') }}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
services:
|
||||
registry:
|
||||
image: registry:2
|
||||
ports:
|
||||
- "127.0.0.1:{{ port }}:5000"
|
||||
volumes:
|
||||
- registry_data:/var/lib/registry
|
||||
- ./config.yml:/etc/docker/registry/config.yml:ro
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
registry_data:
|
||||
28
ansible/roles/docker_registry/templates/vhost.conf.j2
Normal file
28
ansible/roles/docker_registry/templates/vhost.conf.j2
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName {{ hostname }}
|
||||
Redirect permanent / https://{{ hostname }}/
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
ServerName {{ hostname }}
|
||||
SSLEngine on
|
||||
SSLCertificateFile {{ ssl_cert }}
|
||||
SSLCertificateKeyFile {{ ssl_key }}
|
||||
|
||||
# Return an empty OCI index for referrers requests.
|
||||
# registry:2 does not support the OCI referrers API and proxies
|
||||
# the request to upstream which may return HTML error pages,
|
||||
# causing Docker 29+ to fail with "failed to decode referrers index".
|
||||
RewriteEngine on
|
||||
RewriteRule "^/v2/.*/referrers/" - [R=200,L,E=REFERRERS:1]
|
||||
Header always set Content-Type "application/vnd.oci.image.index.v1+json" env=REFERRERS
|
||||
<LocationMatch "^/v2/.*/referrers/">
|
||||
ErrorDocument 200 '{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[]}'
|
||||
</LocationMatch>
|
||||
|
||||
ProxyPreserveHost on
|
||||
RequestHeader set X-Forwarded-Proto "https"
|
||||
RequestHeader set X-Forwarded-Ssl "on"
|
||||
ProxyPass / http://127.0.0.1:{{ port }}/
|
||||
ProxyPassReverse / http://127.0.0.1:{{ port }}/
|
||||
</VirtualHost>
|
||||
Loading…
Add table
Add a link
Reference in a new issue