Search code examples
dockerdocker-composedocker-for-windows

Docker Compose up command times out frequently


I am using Docker For Windows and have a set of images that are already built on my docker host. When I try to use the docker-compose up -d command to start my environment, I frequently face i/o timeout errors for different containers. Usually, retrying helps but I am trying to automate this and can't expect to re-run the whole pipeline.

Versions:

Docker version 18.09.0, build 4d60db4

docker-compose version 1.23.1, build b02f1306

Command line logs:

C:\workspace\AK_DOCKER_RISK\docker-compose>docker-compose up -d
Creating risk-svc ... 
Creating risk-svc ... done
Creating risk-prc ... 
Creating risk-web ... 
Creating risk-web ... error
ERROR: for risk-web  b'i/o timeout'
Creating risk-prc ... done
ERROR: for web  b'i/o timeout'

Encountered errors while bringing up the project.

The error is observed randomly, sometimes for svc, or web or prc.

Can someone please explain why this error is occurring and more importantly - how to solve this issue?

This is my docker-compose.yml file:

version: '3'
services:
  web:
    image: iis-core-web:1910.252
    build:
      context: .
      dockerfile: ./web/Dockerfile
    container_name: risk-web
    ports:
      - "9111:8080"
    tty: true
    links:
      - svc
    volumes:
      - ../RiskLogs/web:c:/RiskLogs
  svc:
    image: iis-core-svc:1910.252
    build:
      context: .
      dockerfile: ./svc/Dockerfile
    container_name: risk-svc
    ports:
      - "9112:8080"
    tty: true
    volumes:
      - ../RiskLogs/svc:c:/RiskLogs
  prc:
    image: iis-core-prc:1910.252
    build:
      context: .
      dockerfile: ./prc/Dockerfile
    container_name: risk-prc
    tty: true
    links:
      - svc
    volumes:
      - ../RiskLogs/prc:c:/RiskLogs
  # prevent creation of new network and use existing nat
networks:
  default:
    external:
      name: nat

Solution

  • Links is a legacy feature. Try user defined networks instead as per docs:

    https://docs.docker.com/compose/compose-file/#links