1

This is my docker compose yaml file

version: "3.7"
services:
  dynamo:
    image: bazel/production/local/docker/dynamodb:dynamodb
    env_file: dynamodb/${ENV}.env
    ports:
      - 7070:7070
    volumes:
        - ${REPO}/production/local/docker/dynamodb/start_dynamo.sh:/home/dynamodblocal/start.sh
        - dynamo-data:/home/dynamodblocal
    entrypoint: ""
    command: /home/dynamodblocal/start.sh

  redis50_cluster:
    image: bazel/production/local/docker/redis50:redis50
    ports:
      - 6380:6380
      - 6381:6381
      - 6382:6382
    volumes:
      - ${REPO}/production/local/docker/redis50/entrypoint.sh:/usr/local/bin/entrypoint.sh
      - ${REPO}/production/local/docker/redis50/redis-cluster-node0.conf:/etc/redis/redis-cluster-node0.conf
      - ${REPO}/production/local/docker/redis50/redis-cluster-node1.conf:/etc/redis/redis-cluster-node1.conf
      - ${REPO}/production/local/docker/redis50/redis-cluster-node2.conf:/etc/redis/redis-cluster-node2.conf
      - ${REPO}/production/local/docker/redis50/init_redis.sh:/usr/local/bin/init_redis.sh
      - ${REPO}/production/local/docker/redis50/check_redis.sh:/usr/local/bin/check_redis.sh
      - redis50-data:/data
    healthcheck:
      test: ["CMD", "check_redis.sh"]
      interval: 60s
      timeout: 5s
      retries: 12
      start_period: 10s

I only want to start up the redis service, so I tried this command

docker-compose -f docker-compose.yml up -d redis50_cluster

however it failed because

ERROR: Couldn't find env file: /Users/antkong/work/production/local/docker/dynamodb/local.env

I really don't care about dynamodb and do not want to go through the setup for it.

Is it possible to ask docker-compose to ignore errors in other sections of yml file?

2
  • 1
    As far as I'm aware, the yaml file will need to be 'valid', even if you are only spinning up one container within it. In this case, because the env file doesn't exist, compose won't be able to finish parsing the file. You could probably comment out problematic lines in the config file, and be able to start what you need.
    – KHobbits
    Sep 4, 2020 at 1:26
  • Thx for your comment! Please kindly turn it into an answer so I can upvote & accept it. Sep 4, 2020 at 1:27

1 Answer 1

4

As far as I'm aware, the yaml file will need to be 'valid', even if you are only spinning up one container within it.

In this case, because the env file doesn't exist, docker-compose won't be able to finish parsing the file.

You could comment out problematic lines in the config file, by starting the line with a # symbol, and be able to start what you need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .