2

I wonder if it's possible to exec commands between two containers (docker exec -it )?

I have a container running Jenkins and another one with my web application, after the build I want that the Jenkins Container send commands directly to the project container. I would like to avoid to use ssh. Is it possible?

Thomas
  • 2,256
  • 6
  • 32
  • 47
  • see some ideas here http://stackoverflow.com/questions/30545023/how-to-communicate-between-docker-containers-via-hostname – user2915097 Mar 18 '16 at 13:03

1 Answers1

1

You need to mount the docker socket from host to the container you want to run command with. See https://forums.docker.com/t/how-can-i-run-docker-command-inside-a-docker-container/337

Xiongbing Jin
  • 11,779
  • 3
  • 47
  • 41