How To Interact with your Docker Containers using docker container exec -it commands?

Steven Rescigno
3 min readJul 15, 2022

A few quick and simple tips on how to access your Docker Containers.

Make sure to have docker installed on your OS. For further instructions on installing Docker visit the link here.

First let’s begin with the following command. We plan to list any current running containers on the OS. This will show all the containers available to execute commands in.

If a Docker Container has a Failed State or a Stopped State, you will not be able to execute a command within it. Make sure your containers are in a running state before running docker container exec -it.

Getting Started with docker container exec -it

Use the following command to list you containers.

docker ps

You’ll now see a table with a few containers running, this will vary depending on your setup.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Next you will need to find the container ID of your project you would like to Exec into using Docker Exec. The format of the container ID will be a hashed ID.

How to Interact With Your Docker Container using the docker…

--

--

Steven Rescigno
Steven Rescigno

Written by Steven Rescigno

Designer | Developer | Medium Author

No responses yet