Docker Community Forums

Share and learn in the Docker community.

Exit from container automatically after 10 or 20 seconds

docker

(Marwenb) #1

Hello every one,
when i’m trying to connect to the container by typing

docker exec -it mycontainer bash

after 5 or 10 second i 'm out from the container automatically
and i don’t know why


(Sam) #2

exec is a one time command… you ran bash, it does nothing.

if u want to connect and work, then use attach

docker attach container

(Marwenb) #3

Thank you for your response , i will apply it :slight_smile: