Search code examples
dockerdocker-registrydockerhubazure-container-service

How to pull docker image from docker hub private registry into Azure Container Service (ACS)?


I have setup a private registry in Docker hub (hub.docker.com): rbiswas/http-service. Now I am trying to pull/run this image into Azure Container Service (ACS) cluster vm by following the steps mentioned below:

First I ssh into the ACS cluster using command:

ssh -i /home/rbiswas/.ssh/acs_rsa -L 2375:localhost:2375 -N rbiswas@swarmclustermgmt.eastasia.cloudapp.azure.com -p 2200

Then I use the following commands in another terminal:

docker -H tcp://localhost:2375 login hub.docker.com
docker -H tcp://localhost:2375 run -i -d -p 8080:8080 rbiswas/http-service

But I am getting the following error even after successful login:

docker: Error response from daemon: Not found.

But if I make the docker hub registry public, then the docker run command is successful. So how do I pull from a Docker Hub private registry?


Solution

  • I solved the issue by running pull and run command separately:

    docker -H tcp://localhost:2375 login
    docker -H tcp://localhost:2375 pull rbiswas/http-service
    docker -H tcp://localhost:2375 run -i -d -p 8080:8080 rbiswas/http-service