Attaching to a container

Run commands directly on the container for the host command line.

If the container was created using the Docker run -d option, it runs in the background. You can attach to the container and use bash instead of docker exec for individual commands.

To open a bash session on the container, use the following command:

docker exec -it container_name bash

For example

docker exec -it my-opscenter bash

To exit the shell without stopping the container use ctl P ctl Q