Exit from container automatically after 10 or 20 seconds

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

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

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