From f1ac93cb83e0357ea76b6b6a82ddb0a7c6cb415f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Maldonado?= <amaldona@etu.utc.fr>
Date: Sun, 5 Apr 2020 16:50:57 +0200
Subject: [PATCH] [pica-registry-test] Init

---
 pica-registry-test/Dockerfile         |  1 +
 pica-registry-test/README.md          | 11 +++++++++++
 pica-registry-test/docker-compose.yml | 27 +++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 pica-registry-test/Dockerfile
 create mode 100644 pica-registry-test/README.md
 create mode 100644 pica-registry-test/docker-compose.yml

diff --git a/pica-registry-test/Dockerfile b/pica-registry-test/Dockerfile
new file mode 100644
index 00000000..0e902f8c
--- /dev/null
+++ b/pica-registry-test/Dockerfile
@@ -0,0 +1 @@
+FROM registry:2.7
diff --git a/pica-registry-test/README.md b/pica-registry-test/README.md
new file mode 100644
index 00000000..311a6090
--- /dev/null
+++ b/pica-registry-test/README.md
@@ -0,0 +1,11 @@
+(WIP)
+
+[Docker Registry](https://docs.docker.com/registry/) used by the CI/CD in this repo for image testing.
+
+## Usage
+
+### First time
+
+1. Generate a password in [picapass](https://gitlab.utc.fr/picasoft/interne/pass/)
+2. Generate a new `htpasswd` file with `htpasswd -Bn <username>`. This will prompt you for the password and will display results on stdout
+3. In the target VM, create `./secrets/htpasswd` and paste there the output of the previous command
diff --git a/pica-registry-test/docker-compose.yml b/pica-registry-test/docker-compose.yml
new file mode 100644
index 00000000..b5703426
--- /dev/null
+++ b/pica-registry-test/docker-compose.yml
@@ -0,0 +1,27 @@
+version: "3"
+
+volumes:
+  registry-data:
+
+networks:
+  docker_default:
+    external: true
+
+services:
+  registry:
+    container_name: registry
+    restart: always
+    image: registry:2
+    environment:
+      REGISTRY_AUTH: htpasswd
+      REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
+      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
+      REGISTRY_STORAGE_DELETE_ENABLED: "true"
+      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
+    volumes:
+      - registry-data:/var/lib/registry
+      - ./secrets/htpasswd:/auth/htpasswd
+    labels:
+      - "traefik.frontend.rule=Host:registry.test.picasoft.net"
+      - "traefik.port=5000"
+      - "traefik.enable=true"
-- 
GitLab