-2

Im trying to run the docker command using the below command but it does not take me to the interactive mode.

docker container run -d  -it --privileged centos 
2
  • 3
    Try without -d option
    – Konrad
    Apr 10, 2019 at 15:25
  • 1
    If you look at the docker run man page, you'll note that -d means --detach ("run the container in the background...")
    – larsks
    Apr 10, 2019 at 15:26

1 Answer 1

2

After starting your container, you can use

docker exec -it your_container_name /bin/bash

command to connect container's terminal. (assuming container's image includes /bin/bash).

1
  • On Windows with MinTTY it is: docker exec -it your_container_name bash Feb 11, 2020 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.