Manage docker from your terminal

Manage docker from your terminal
Photo by Luca Bravo / Unsplash

Docker is a fantastic tool, that allows you to port your code through different environments and you will expect the same result, on the other hand, you can have any resource ready to use with almost no config from you, so you can have a full database as MySQL, Redis, MongoDB, prepared to use in seconds, so, definitely Docker accelerate your productivity and eliminates complex config processes. Docker is great no?

Docker software is composed of two components:

  • Docker Engine: The Software that host the containers.
  • Docker Desktop: The Software to interact with the containers.

But, at this point we should wonder an important question, is Docker free or paid? well, the long answer is, we can say that Docker has free and paid tiers..., and more, the short answer is, you can use the Docker engine for free, but, not Docker Desktop (it is restricted only for personal).

  • Docker Engine 👍
  • Docker Desktop ❌

so, if you're working on a project for your company you should find an alternative to Docker Desktop, the good news is, you can manage your containers from your terminal with LazyDocker.

according to LazyDocker on their GitHub page, LazyDocker is:

A simple terminal UI for both docker and docker-compose, written in Go with the gocui library.
Lazydocker in action

You can install it, or, why not, you can use it as another container more, yep, the Docker way, so let's do it with the below docker run command:

docker run --rm -it -v \
/var/run/docker.sock:/var/run/docker.sock \
-v /yourpath:/.config/jesseduffield/lazydocker \
lazyteam/lazydocker
lazy docker as container
  • Don't forget to change /yourpath to an actual path you created to store lazydocker's config, for instance:
docker run --rm -it -v \
/var/run/docker.sock:/var/run/docker.sock \
-v /home/MY-USER/.lazy-docker:/.config/jesseduffield/lazydocker \
lazyteam/lazydocker
lazy docker command example
  • You might want to create an alias, for example:

echo "alias lzd='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /yourpath/config:/.config/jesseduffield/lazydocker lazyteam/lazydocker'" >> ~/.zshrc

and that is all, you're ready to use LazyDocker from your terminal as an alternative to DockerDesktop.

everything is one key press away (or one click away! Mouse support FTW), you can move with arrows, and press x key to see the available options.

PD. if the terminal is not your cup of tea, what about the browser?, visit my other posts to see how to handle Docker from your browser.

To know more about LazyDocker please visit their GitHub:

GitHub - jesseduffield/lazydocker: The lazier way to manage everything docker
The lazier way to manage everything docker. Contribute to jesseduffield/lazydocker development by creating an account on GitHub.