From d0861c0ef2d505206df0839f219fa822d58fd40a Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Mon, 8 May 2023 16:35:22 +0300 Subject: [PATCH] first settings --- .env | 4 ++++ README.md | 7 +++++++ docker-compose.yml | 23 +++++++++++++++++++++++ registry.passwd | 1 + 4 files changed, 35 insertions(+) create mode 100644 .env create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 registry.passwd diff --git a/.env b/.env new file mode 100644 index 0000000..5acabcf --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +REGISTRY_AUTH=htpasswd +REGISTRY_AUTH_HTPASSWD_REALM=Registry +REGISTRY_AUTH_HTPASSWD_PATH=/auth/registry.password +REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec92be6 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Registry + +Создание файла с аутентификацией: + +```sh +~ $ htpasswd -Bc registry.passwd docker-adm +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fbbe64b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +# networks: +# db_registry: +# name: db_registry + +services: + registry: + image: registry:2 + container_name: registry + # user: 1000:1000 + restart: always + environment: + - REGISTRY_AUTH:${REGISTRY_AUTH} + - REGISTRY_AUTH_HTPASSWD_REALM:${REGISTRY_AUTH_HTPASSWD_REALM} + - REGISTRY_AUTH_HTPASSWD_PATH:${REGISTRY_AUTH_HTPASSWD_PATH} + - REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY:${REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY} + # networks: + # - db_registry + ports: + - 5000:5000 + volumes: + # - /var/volumes/registry:/var/lib/registry + - /var/volumes/registry/data:/data + - /var/volumes/registry/auth:/auth diff --git a/registry.passwd b/registry.passwd new file mode 100644 index 0000000..85346ae --- /dev/null +++ b/registry.passwd @@ -0,0 +1 @@ +docker-adm:$2y$05$e66Y.9UqZYw1IMyLxuMdveaX31rJlIb7WNytgVv/KVaJQ5gjAIpq2