loading...
Cover image for Docket : connect to your docker's container easily !

Docket : connect to your docker's container easily !

pobb profile image pob ・2 min read

I'll introduce you today a tool helping you to connect to docker containers quickly and easily using CLI.

The current docker way you already know is simple. If you want to connect to one of your running containers, you have to execute "docker ps" command, listing all your (running) containers informations.

Next you have to execute "docker exec -it my_container bash" command. This will connect you in your container to a bash session.

Every time I use the "docker ps" command, I get a long and large table. Unreadable if your terminal is not with 6px font-size .. On my terminal it looks like this :

docker ps command

Not really easy to read. But because I hate loose my time and love to find funny's solutions, I tried to develop a script that automatically get all containers available in "docker ps" command, only displaying "name" in a list option. I just have to select the right one with my keyboard, and it give me the good bash session, that's all !

Docket : docker in your pocket !

That's why Docket is born : in a few lines of bash or ruby (maybe one day it will be available in python too), job is done !

Recordit GIF

All of my mates that saw it on my computer just asked to use it, so maybe it will be useful to you too! Go on the GitHub project for setup instructions. You just have to download script (bash or ruby, as you want), and execute it. For more comfortable use, you can create an alias.

Posted on by:

pobb profile

pob

@pobb

French developer, love ruby, tests, agility and "kiss" tricks !

Discussion

markdown guide