10

I have 2 services with 2 different images in my docker-compose.yml, when I run "docker-compose up -d", containers are started properly, but when i try to do "docker attach ", container restarts.

Can anyone please explain this behavior. How can attach to the container?

Srinivasa Prasad
  • 203
  • 1
  • 2
  • 9

1 Answers1

10

if you want to go to your running compose container you can start new shell and attach to it

docker-compose exec servicename sh

or if you really want to attach to it just do docker-compose up

Mazel Tov
  • 2,064
  • 14
  • 26