GUI to Docker Containers

Visakh Vijayan - Apr 7 '20 - - Dev Community

One of the main things you would like to do when you are running Docker containers is communicating with them. Although there are tools like kitematic which provide a GUI interface to use docker, we still somehow stick to the CLI version.

Docker in brief

In brief, a container is an encapsulated version of your source code along with its dependencies. Think of it as a box of the good stuff which will run everywhere. The host OS talks to the container which in turn allows you to access it via the host OS.

Start by showing all containers in your system at present -

docker container ls
Enter fullscreen mode Exit fullscreen mode

The leftmost part will show you the Container Ids

Now, what if you want to access it directly. Sure there are CLI commands for that - one such being

docker exec -it <containerId> bash
Enter fullscreen mode Exit fullscreen mode

But how about a GUI client. Well below is a small workaround.

docker inspect <containerId>
Enter fullscreen mode Exit fullscreen mode

This gives you a json as follows

Mongo Container

What you will need is the IPAddress part. Just copy that IP address and go to your GUI client and paste it there.

robomongo

For eg. I was using a mongo container in the above picture. And below is a screen of the robomongo GUI connecting to the container.

Robo connected

I hope it helps!

PS: Use the VSCode's awesome docker extension. Makes life super easy

Happy coding :D
Stay safe everyone

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .