Procházet zdrojové kódy

registry push helper

orbitzs před 3 roky
rodič
revize
a452862714

+ 17 - 10
docker-registry/docker-compose.bak

@@ -2,21 +2,28 @@ version: '3'
 services:
   docker-registry:
     image: registry:2
-    restart : always
-    container_name: docker-registry
+    restart : "no" 
+    container_name: ${CONTAINER_NAME} 
     ports:
-    - "5000:5000"
+    - "8256:5000"
     environment:
       REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
     volumes:
-      - ./data:/data
+      - ${DATA_ROOT}/data:/data
+      - ${DATA_ROOT}/config/config.yml:/etc/docker/registry/config.yml
+
   docker-registry-ui:
-    image: konradkleine/docker-registry-frontend:v2
+    image: joxit/docker-registry-ui:latest 
     restart : "no" 
-    container_name: docker-registry-ui
+    container_name: ${CONTAINER_NAME}-ui
     ports:
-    - 8099:443
+    - 8255:80
+    volumes:
+      - ${DATA_ROOT}/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
     environment:
-      ENV_DOCKER_REGISTRY_HOST: 192.168.1.118  
-      ENV_DOCKER_REGISTRY_PORT: 5000
-      ENV_DOCKER_REGISTRY_USE_SSL: 0 
+      - SINGLE_REGISTRY=true
+      - REGISTRY_TITLE=My Private Docker Registry
+      - DELETE_IMAGES=true
+      - SHOW_CONTENT_DIGEST=true
+    depends_on:
+      - docker-registry

+ 5 - 0
docker-registry/nginx/nginx.conf

@@ -1,6 +1,11 @@
 server {
   listen 80;
   root /usr/share/nginx/html;
+
+  #  the below line has no effect 
+  #  to allow unchecked upload limits, add the line below in the nginx.conf at sslwp docker where it is the first point of contact by a client call 
+  #client_max_body_size 0;
+
   location /v2  {
      proxy_pass http://docker-registry:5000;
   }

+ 18 - 0
script/docker_push_all.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+server=hubreg.algometic.com
+docker images --format {{.Repository}}:{{.Tag}} |&
+while read -p first second; do
+   if [[ $1 == "noexec" ]]
+   then
+       echo docker tag $second $server/$second
+       echo docker push $server/$second 
+   elif [[ $1 == "push" ]] 
+   then
+       docker tag $second $server/$second
+       docker push $server/$second 
+   else
+       echo "Usage: docker_push_all.sh {noexec|push}"
+       break 
+   fi       
+done
+