user1179299
user1179299

Reputation: 366

run 'docker-compose up' with detached and interactive services

My docker compose looks like :

version: '2.1'
services:
  rabbitmq:
    image: "rabbitmq"
    ports:
     - "5672:5672"
     - "15672:15672"
     - "61613:61613"
  a:
    build: ./a
    hostname: "a"
    ports:
      - "49297:49297"
    links:
      - "rabbitmq"
  b:
    build: ./b
    hostname: "b"
    ports:
      - "49597:49297"
    links:
      - "rabbitmq"

I want to see logs from services a and b; and not for rabbitmq. When I do, "docker-compose up --build" logging from all the three service starts.

I want to use "-d"(detached) with rabbitmq; but unable to find the right syntax. Any ideas?

Upvotes: 1

Views: 339

Answers (1)

sp0gg
sp0gg

Reputation: 4122

Would this work for your case:

docker-compose up -d rabbitmq && docker-compose up a b

Upvotes: 1

Related Questions