title: docker-compose tries to access registry v1 on first "up"
body: <p>I have a docker-compose file that looks like this:</p>
  
  <pre><code>version: '2'
  services:
    registry:
      restart: always
      image: registry:2
      ports:
        - 5000:5000
      environment:
        REGISTRY_STORAGE: "s3"
        REGISTRY_STORAGE_S3_ACCESSKEY: "yada"
        REGISTRY_STORAGE_S3_SECRETKEY: "yada"
        REGISTRY_STORAGE_S3_REGION: "us-east-1"
        REGISTRY_STORAGE_S3_BUCKET: "docker-registry"
        REGISTRY_STORAGE_S3_ENCRYPT: "true"
        REGISTRY_STORAGE_S3_SECURE: "true"
        REGISTRY_STORAGE_S3_V4AUTH: "true"
        REGISTRY_STORAGE_S3_CHUNKSIZE: "5242880"
     volumes:
       - ./data:/data
  
   prototype:
      restart: always
      image: localhost:5000/prototype
      ports:
        - 8081:8081
      volumes:
        - /opt/config:/config
      depends_on:
        - registry  
  </code></pre>
  
  <p>The weird thing is on the first run the compose file tries to pull from registry v1, not v2.  On the second run, everything works fine.  I was hoping the "depends_on" would prevent this. Am I doing something wrong here?</p>
  
  <p>First run:</p>
  
  <pre><code># docker-compose up
  Starting docker_registry_1
  Recreating docker_prototype_1
  Pulling prototype (localhost:5000/prototype:latest)...
  Pulling repository localhost:5000/prototype
  ERROR: Error while pulling image: Get http://localhost:5000/v1/repositories/prototype/images: read tcp [::1]:35416-&gt;[::1]:5000: read: connection reset by peer
  </code></pre>
  
  <p>Note the "v1" in the URL.</p>
  
  <p>Second run:</p>
  
  <pre><code># docker-compose up
  docker_registry_1 is up-to-date
  Recreating 9a743a171c84_docker_prototype_1
  Pulling prototype (localhost:5000/prototype:latest)...
  latest: Pulling from prototype
  a3ed95caeb02: Already exists
  3286cdf780ef: Already exists
  ...and so on
  </code></pre>