work on xai-corp vm servers
This commit is contained in:
@@ -4,16 +4,17 @@ registry:
|
||||
ports:
|
||||
- 5000:5000
|
||||
environment:
|
||||
REGISTRY_HTTP_SECRET: aabuioqlwlcpp2
|
||||
# REGISTRY_HTTP_TLS_CERTIFICATE: /certs/cert.pem
|
||||
# REGISTRY_HTTP_TLS_KEY: /certs/privkey.pem
|
||||
# REGISTRY_HTTP_LETSENCRYPT_CACHEFILE:
|
||||
REGISTRY_HTTP_LETSENCRYPT_CACHEFILE: /var/run/letsencrypt.cache
|
||||
REGISTRY_HTTP_LETSENCRYPT_EMAIL: r_morgan@sympatico.ca
|
||||
REGISTRY_HTTP_HOST: https://192.168.2.41:5000
|
||||
# REGISTRY_HTTP_HOST: https://192.168.2.41:5000
|
||||
# REGISTRY_HTTP_ADDR: 192.168.2.41:5000
|
||||
# REGISTRY_AUTH: htpasswd
|
||||
# REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
|
||||
# REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
|
||||
REGISTRY_AUTH: htpasswd
|
||||
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
|
||||
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
|
||||
volumes:
|
||||
- /opt/dkregistry/data:/var/lib/registry
|
||||
- /opt/shared/dkregistry/data:/var/lib/registry
|
||||
- /etc/letsencrypt/live/dkregistry.xai-corp.net:/certs
|
||||
- /opt/dkregistry/auth:/auth
|
||||
- /opt/shared/dkregistry/auth:/auth
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
# Main task for creating a docker registry
|
||||
|
||||
- name: clean up old config
|
||||
command: "rm -rf /opt/dkrepository"
|
||||
command: "{{ item }}"
|
||||
with_items:
|
||||
- "rm -rf /opt/dkrepository"
|
||||
- "rm -rf /opt/shared/dkrepository/auth"
|
||||
|
||||
# create folders for certs, data,
|
||||
- name: create data folders (/opt/dkregistry)
|
||||
@@ -13,15 +16,15 @@
|
||||
group: docker
|
||||
mode: 0770
|
||||
with_items:
|
||||
- /opt/dkregistry/data
|
||||
- /opt/dkregistry/auth
|
||||
- /opt/shared/dkregistry/data
|
||||
- /opt/shared/dkregistry/auth
|
||||
|
||||
# make auth files using docker container
|
||||
- name: create auth file
|
||||
shell: echo '' > /opt/dkregistry/auth/htpasswd
|
||||
shell: echo '' > /opt/shared/dkregistry/auth/htpasswd
|
||||
|
||||
- name: add user to auth file
|
||||
shell: "docker run --entrypoint htpasswd registry:2 -Bbn {{ item.name }} {{ item.pass }} >> /opt/dkregistry/auth/htpasswd"
|
||||
shell: "docker run --entrypoint htpasswd registry:2 -Bbn {{ item.name }} {{ item.pass }} >> /opt/shared/dkregistry/auth/htpasswd"
|
||||
with_items:
|
||||
- { "name" : "richard", "pass" : "richard" }
|
||||
- { "name" : "testuser", "pass" : "testpassword" }
|
||||
@@ -32,6 +35,6 @@
|
||||
dest: /opt/dkregistry/docker-compose.yml
|
||||
|
||||
- name: run docker up
|
||||
shell: "docker-compose up -d"
|
||||
shell: "docker-compose down && docker-compose create && docker-compose start"
|
||||
args:
|
||||
chdir: /opt/dkregistry
|
||||
|
||||
Reference in New Issue
Block a user