The Wayback Machine - http://web.archive.org/web/20191210001350/https://medium.com/@calbertts/docker-and-fuzzy-finder-fzf-4c6416f5e0b5

Docker and Fuzzy Finder (fzf)

Carlos Alberto
Feb 12, 2017 · 3 min read

If you work with docker, and like me, don’t like to use UIs but the terminal to express what you want, this article may help you.

Image
Image

All we know that many devs spend tons of hours using the terminal, although it’s cool, sometimes it can become a pain when the things you want to express are too long, that’s what’s been happening to me with docker, you should know what I mean.

That’s why I want to show you how to create custom commands and comfortable interactive menus in your terminal by using the amazing project FuzzyFinder to make your life easier.

fzf is a general-purpose command-line fuzzy finder that can be used to create custom interactive menus from the terminal, learn more in the github repository, first of all install fzf in your system:

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

I’ve made the hardest part for you by learning bash and coding all the examples in this article, to make it work, you just have to add them to your .bash_profile and reload it in your current session, by the way, Bash 4 is a requirement to make them work.

vim ~/.bash_profile     # edit
source ~/.bash_profile # reload

Running containers

The first command is runc, which is from now an amazing command to run a new container by selecting the docker image from a interactive menu

Image
Image
Runs a docker container from an image

Running commands in already running containers

Sometimes you just need to run a command in already running container, but it’s pretty annoying to list all the running containers just to get the container’s ID or name, now you can have runinc

Image
Image
Runs a command in already running docker container

Stopping/Removing containers

Stop or a remove a container choosing it from a fancy menu, removing is optional.

Image
Image
Stops and/or removes a docker container

Getting the container’s IP Address

Inspect the IP address quickly choosing the container from the menu by running showipc

Image
Image

As you can see, these are just few examples about how to operate with fzf and docker, you can adapt them to make them work as you want, hope you find it useful and suggestions or new commands are welcome.

:)

Carlos Alberto

Written by

Software Developer ~

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade