Docker Command To Access Bast Terminal Inside A Container


This short notes is the answer to the command to access the terminal inside a Linux Docker container.

First, find the container id with the following command:

$ docker ps -a

Now that you have the container id, you can use the following command:

$ sudo docker exec -i -t [DOCKERID] /bin/bash

For NGINX server you can try this command:

$ docker exec -it [DOCKERID] sh