Jianfeng Li
Jianfeng Li

Reputation: 19

docker-compose up stuck on "Attaching to ...."

I run the below command under the docker-compose.yml folder:

docker-compose up

my "docker-compose.yml" file:

version: '3'

services:
  ubuntu:
    image: "ubuntu:latest"
    tty: true

But the issue is:

Jianfengs-MBP:homedocker jianfengli$ docker-compose up ubuntu
Recreating homedocker_ubuntu_1 ... done
Attaching to homedocker_ubuntu_1

My docker info(About docker)

Engine: 18.06.1-ce Compose: 1.22.0

Upvotes: 1

Views: 4569

Answers (1)

alexpriftuli
alexpriftuli

Reputation: 66

This is the expected behaviour. After attaching it goes to print logs, but if there are no logs then it just waits.

If you want up to exit use up docker-compose up -d

Upvotes: 2

Related Questions