BradleyA / Search-docker-registry-v2-script.1.0

view-private-registry is a simple bash script for listing images in a private registry v2, docker search registry-v2
MIT License
50 stars 16 forks source link

How to access remote Docker private registry #5

Closed arjunm183 closed 8 years ago

arjunm183 commented 8 years ago

The script which you provide has to be executed in the host where docker registry is deployed.

Is there a way to access remote docker private registry on v2.

Api doesnt work for me

BradleyA commented 8 years ago

No, it has to be executed on a system that includes the filesystem where the images are stored. I use NFS to mount the image filesystem on any host I need to run the script. You could use the ssh command to run a command on a remote host:

$ ssh uthree@192.168.1.203 ' /usr/local/bin/view-private-registry' Ubuntu 14.04.4 LTS Enter passphrase for key '/home/uone/.ssh/id_rsa': alpine:latest behemphi/docker-minecraft:latest busybox:latest datadog/docker-dd-agent:latest datadog/docker-dogstatsd:latest defermat/machine:latest docker-dns:latest dockerswarm/swarm:latest gcr.io/google_containers/etcd:2.0.9 gcr.io/google_containers/hyperkube:v0.21.2 gcr.io/google_containers/pause:0.8.0 google/cadvisor:latest guttertec/hubot:latest jenkins:latest logstash:latest million12/logstash:latest million12/mariadb:latest million12/zabbix-agent:latest million12/zabbix-server:latest mongo:latest mysql:latest nate/dockviz:latest nginx:latest opendocker/jenkins:latest phensley/docker-dns:latest php:latest python:2.7 rancher/agent-instance:v0.3.1 rancher/agent:latest rancher/agent:v0.7.9 rancher/server:latest redis:latest registry:2.1.1 socketplane/openvswitch:latest socketplane/socketplane:latest spotify/kafka:latest stackengine/controller:latest tomcat:7 tomcat:latest ubuntu:14.04.2 Number of images: 40 Disk space used: 4.2G /mnt/three/docker-registry/registry-data

Hope that helps.

arjunm183 commented 8 years ago

I understand thats the way of accessing it by mounting the file system over nfs. What if i have some 50 nodes and i have to mount using autofs or nfs which consumes network bandwidth and again an administration of this.. I understand your script clearly, however do you have any idea on calling remote api instead of mounting directory over nfs on all the clients.

BradleyA commented 8 years ago

Here is a script that can access the view-private-registry script remotely from any of your 5000 nodes. It includes the ssh command line in my earlier response. I am running a Docker Swarm cluster with Docker 1.12r5. I only start my containers on the cluster manager nodes which have the mounted NFS registry V2 filesystem.

BradleyA commented 8 years ago

Hope that answered your question, Not hearing back from you I am closing the incident. Feel free to reopen if you need to.