title: Error running containers with docker-compose, error pulling images from my private repo in dockerhub
body: <p>I have 3 images pushed on my private repository in docker hub.
  Locally, the way I've always run the 3 images is via docker-compose up -d, and it works. </p>
  
  <p>Now I'm trying to run this images in a different server so I pushed them in a private repository in docker hub. </p>
  
  <p>So in order to run them in the new server this is what I do:</p>
  
  <p>1- I run docker login with my docker hub credentials</p>
  
  <pre><code>WARNING! Your password will be stored unencrypted in /home/user/.docker/config.json.
  Configure a credential helper to remove this warning. See
  https://docs.docker.com/engine/reference/commandline/login/#credentials-store
  
  Login Succeeded
  </code></pre>
  
  <p>2- I pulled them manually with no error:</p>
  
  <pre><code>~$ docker pull user/repo:tag
  mongo: Pulling from user/repo
  Digest: sha256:9c6a336963e6f680aa9550d502bc777e212f0025d22229fd60cb5826289f84e4
  Status: Image is up to date for user/repo:tag
  </code></pre>
  
  <p>So I copied there my docker-compose.yml:</p>
  
  <p>version: '3.1'</p>
  
  <pre><code>services:
    engine:
      image: engine
      container_name: engine
      ports:
        - 5000:5000
      volumes:
        - $HOME/data/engine-import:/app/import
      depends_on:
        - mongo
  
    mongo:
      image: mongo
      container_name: mongo
      ports:
        - 27018:27017
      volumes:
        - $HOME/data/mongo-data:/data/db
        - $HOME/data/mongo-bkp:/data/bkp
      restart: always
  </code></pre>
  
  <p>-BUT- Even though I have the images there, when I run docker-compose up -d this is what I get:</p>
  
  <pre><code>Pulling mongo (mongo:)...
  ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
  </code></pre>
  
  <p>and if I enter "Y" it tries to pull with no success...</p>
  
  <pre><code>Pulling mongo (mongo:)...
  ERROR: pull access denied for mongo, repository does not exist or may require 'docker login'
  </code></pre>
  
  <p>And I did login right before.</p>
  
  <p>I'd appreciate any help</p>
  
  <p><strong>UPDATE</strong>: adding a --verbose flag this is the whole output:</p>
  
  <pre><code>compose.config.config.find: Using configuration files: ./docker-compose.yml
  docker.utils.config.find_config_file: Trying paths: ['/home/myuser/.docker/config.json', '/home/myuser/.dockercfg']
  docker.utils.config.find_config_file: Found file at path: /home/myuser/.docker/config.json
  docker.auth.load_config: Found 'auths' section
  docker.auth.parse_auth: Found entry (registry='https://index.docker.io/v1/', username='akapit')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/version HTTP/1.1" 200 557
  compose.cli.command.get_client: docker-compose version 1.21.2, build a133471
  docker-py version: 3.3.0
  CPython version: 3.6.5
  OpenSSL version: OpenSSL 1.0.1t  3 May 2016
  compose.cli.command.get_client: Docker base_url: http+docker://localhost
  compose.cli.command.get_client: Docker version: Platform={'Name': ''}, Components=[{'Name': 'Engine', 'Version': '18.06.0-ce', 'Details': {'ApiVersion': '1.38', 'Arch': 'amd64', 'BuildTime': '2018-07-18T19:09:05.000000000+00:00', 'Experimental': 'false', 'GitCommit': '0ffa825', 'GoVersion': 'go1.10.3', 'KernelVersion': '4.15.13-x86_64-linode106', 'MinAPIVersion': '1.12', 'Os': 'linux'}}], Version=18.06.0-ce, ApiVersion=1.38, MinAPIVersion=1.12, GitCommit=0ffa825, GoVersion=go1.10.3, Os=linux, Arch=amd64, KernelVersion=4.15.13-x86_64-linode106, BuildTime=2018-07-18T19:09:05.000000000+00:00
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network &lt;- ('outflink_default')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/networks/outflink_default HTTP/1.1" 200 555
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network -&gt; {'Attachable': True,
   'ConfigFrom': {'Network': ''},
   'ConfigOnly': False,
   'Containers': {},
   'Created': '2018-08-15T12:59:22.828407238Z',
   'Driver': 'bridge',
   'EnableIPv6': False,
   'IPAM': {'Config': [{'Gateway': '172.18.0.1', 'Subnet': '172.18.0.0/16'}],
            'Driver': 'default',
            'Options': None},
  ...
  compose.cli.verbose_proxy.proxy_callable: docker info &lt;- ()
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/info HTTP/1.1" 200 None
  compose.cli.verbose_proxy.proxy_callable: docker info -&gt; {'Architecture': 'x86_64',
   'BridgeNfIp6tables': True,
   'BridgeNfIptables': True,
   'CPUSet': True,
   'CPUShares': True,
   'CgroupDriver': 'cgroupfs',
   'ClusterAdvertise': '',
   'ClusterStore': '',
   'ContainerdCommit': {'Expected': 'd64c661f1d51c48782c9cec8fda7604785f93587',
                        'ID': 'd64c661f1d51c48782c9cec8fda7604785f93587'},
  ...
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network &lt;- ('outflink_default')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/networks/outflink_default HTTP/1.1" 200 555
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network -&gt; {'Attachable': True,
   'ConfigFrom': {'Network': ''},
   'ConfigOnly': False,
   'Containers': {},
   'Created': '2018-08-15T12:59:22.828407238Z',
   'Driver': 'bridge',
   'EnableIPv6': False,
   'IPAM': {'Config': [{'Gateway': '172.18.0.1', 'Subnet': '172.18.0.0/16'}],
            'Driver': 'default',
            'Options': None},
  ...
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=False, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=0&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=mongo', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dmongo%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=mongo', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dmongo%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=engine', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dengine%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=engine', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dengine%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker inspect_image &lt;- ('mongo')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/images/mongo/json HTTP/1.1" 404 82
  compose.service.pull: Pulling mongo (mongo:)...
  compose.cli.verbose_proxy.proxy_callable: docker pull &lt;- ('mongo', tag='latest', stream=True, platform=None)
  docker.auth.get_config_header: Looking for auth config
  docker.auth.resolve_authconfig: Looking for auth entry for 'docker.io'
  docker.auth.resolve_authconfig: Found 'https://index.docker.io/v1/'
  docker.auth.get_config_header: Found auth config
  urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/images/create?tag=latest&amp;fromImage=mongo HTTP/1.1" 404 109
  ERROR: compose.cli.main.up: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.
  
  Continue with the new image? [yN]y
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network &lt;- ('outflink_default')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/networks/outflink_default HTTP/1.1" 200 555
  compose.cli.verbose_proxy.proxy_callable: docker inspect_network -&gt; {'Attachable': True,
   'ConfigFrom': {'Network': ''},
   'ConfigOnly': False,
   'Containers': {},
   'Created': '2018-08-15T12:59:22.828407238Z',
   'Driver': 'bridge',
   'EnableIPv6': False,
   'IPAM': {'Config': [{'Gateway': '172.18.0.1', 'Subnet': '172.18.0.0/16'}],
            'Driver': 'default',
            'Options': None},
  ...
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=False, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=0&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=mongo', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dmongo%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=mongo', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dmongo%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=engine', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dengine%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker containers &lt;- (all=True, filters={'label': ['com.docker.compose.project=outflink', 'com.docker.compose.service=engine', 'com.docker.compose.oneoff=False']})
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/containers/json?limit=-1&amp;all=1&amp;size=0&amp;trunc_cmd=0&amp;filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Doutflink%22%2C+%22com.docker.compose.service%3Dengine%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
  compose.cli.verbose_proxy.proxy_callable: docker containers -&gt; (list with 0 items)
  compose.cli.verbose_proxy.proxy_callable: docker inspect_image &lt;- ('mongo')
  urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/images/mongo/json HTTP/1.1" 404 82
  compose.service.pull: Pulling mongo (mongo:)...
  compose.cli.verbose_proxy.proxy_callable: docker pull &lt;- ('mongo', tag='latest', stream=True, platform=None)
  docker.auth.get_config_header: Looking for auth config
  docker.auth.resolve_authconfig: Looking for auth entry for 'docker.io'
  docker.auth.resolve_authconfig: Found 'https://index.docker.io/v1/'
  docker.auth.get_config_header: Found auth config
  urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/images/create?tag=latest&amp;fromImage=mongo HTTP/1.1" 404 109
  ERROR: compose.cli.errors.log_api_error: pull access denied for mongo, repository does not exist or may require 'docker login'`
  </code></pre>
  
  <p>My docker-compose version is <code>docker-compose version 1.22.0, build f46880fe</code></p>
  
  <p>Thanks</p>