lazydocker README

The project's README from github.com/jesseduffield/lazydocker. As one markdown file: README.md.

Special thanks to:

Warp
Warp, the intelligent terminal
Available for MacOS and Linux
Visit warp.dev to learn more.


Tuple
Tuple, the premier screen sharing app for developers on macOS and Windows.



Subble
Click here to learn more


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

CI Go Report Card GolangCI GoDoc GitHub repo size GitHub Releases GitHub tag homebrew

Gif

Demo

Sponsors

Maintenance of this project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. 💙

Mark LussierDean HerbertPeter BjorklundReilly WoodOliver GüntherPawan DhananjayBartłomiej DachDavid KarlssonCarsten GehlingCEUKAkos PutzXeteraHolden LucasChau TranmatejciktheAverageDev (Luca Tumedei)Ivan ZaitsevNicholas CloudLightQuantumGabriel SaillardAliaksandr StelmachonakBurgy BenjaminJoe KlemmerTobias LütkeBen BeaumontHollyJames SantucciJeff ForcierMaciej T. NowakFarzad MajidfayyazYuryAndreas KurthBraden SteffaniakJordan GillardSebastianGeorge SpanosFrantisek StankoAndy SlezakMartin KockIllarion KoperskiJesse AlamaCodacyBrettJan HeijmansKevin Nowaldsem pruijsOmar Luq Ethan LiBrian MacAskillMaxinbrJan ZenknerVictor AremuIgor RamazanovElliott Maguiren8n - Workflow Automationkaleb allmonJosh ThomasJJFrederick MorlockDarren CraineMaximilian LangenfeldNurzhanDavis BulsGrec MarcsainuMarc Güell SegarraChris OlsenVladimir PopovNeil LambertShaun GarwoodDavid Heinemeier HanssonWayan jimmy

Elevator Pitch

Minor rant incoming: Something's not working? Maybe a service is down. docker-compose ps. Yep, it's that microservice that's still buggy. No issue, I'll just restart it: docker-compose restart. Okay now let's try again. Oh wait the issue is still there. Hmm. docker-compose ps. Right so the service must have just stopped immediately after starting. I probably would have known that if I was reading the log stream, but there is a lot of clutter in there from other services. I could get the logs for just that one service with docker compose logs --follow myservice but that dies everytime the service dies so I'd need to run that command every time I restart the service. I could alternatively run docker-compose up myservice and in that terminal window if the service is down I could just up it again, but now I've got one service hogging a terminal window even after I no longer care about its logs. I guess when I want to reclaim the terminal realestate I can do ctrl+P,Q, but... wait, that's not working for some reason. Should I use ctrl+C instead? I can't remember if that closes the foreground process or kills the actual service.

What a headache!

Memorising docker commands is hard. Memorising aliases is slightly less hard. Keeping track of your containers across multiple terminal windows is near impossible. What if you had all the information you needed in one terminal window with every common command living one keypress away (and the ability to add custom commands as well). Lazydocker's goal is to make that dream a reality.

Requirements

Installation

Homebrew

Normally lazydocker formula can be found in the Homebrew core but we suggest you to tap our formula to get frequently updated one. It works with Linux, too.

Tap:

brew install jesseduffield/lazydocker/lazydocker

Core:

brew install lazydocker

Scoop (Windows)

You can install lazydocker using scoop:

scoop install lazydocker

Chocolatey (Windows)

You can install lazydocker using Chocolatey:

choco install lazydocker

asdf-vm

You can install asdf-lazydocker plugin using asdf-vm:

Setup (Once)

asdf plugin add lazydocker https://github.com/comdotlinux/asdf-lazydocker.git

For Install / Upgrade

asdf list all lazydocker
asdf install lazydocker latest
asdf global lazydocker latest

Binary Release (Linux/OSX/Windows)

You can manually download a binary release from the release page.

Automated install/update, don't forget to always verify what you're piping into bash:

curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash

The script installs downloaded binary to $HOME/.local/bin directory by default, but it can be changed by setting DIR environment variable.

Go

Required Go Version >= 1.19

go install github.com/jesseduffield/lazydocker@latest

Required Go version >= 1.8, <= 1.17

go get github.com/jesseduffield/lazydocker

Arch Linux AUR

You can install lazydocker using the AUR by running:

yay -S lazydocker

Docker

Docker Pulls Docker Stars Docker Automated

  1. Click if you have an ARM device

    • If you have a ARM 32 bit v6 architecture

      docker build -t lazyteam/lazydocker \
      --build-arg BASE_IMAGE_BUILDER=arm32v6/golang \
      --build-arg GOARCH=arm \
      --build-arg GOARM=6 \
      https://github.com/jesseduffield/lazydocker.git
      
    • If you have a ARM 32 bit v7 architecture

      docker build -t lazyteam/lazydocker \
      --build-arg BASE_IMAGE_BUILDER=arm32v7/golang \
      --build-arg GOARCH=arm \
      --build-arg GOARM=7 \
      https://github.com/jesseduffield/lazydocker.git
      
    • If you have a ARM 64 bit v8 architecture

      docker build -t lazyteam/lazydocker \
      --build-arg BASE_IMAGE_BUILDER=arm64v8/golang \
      --build-arg GOARCH=arm64 \
      https://github.com/jesseduffield/lazydocker.git
      

  2. Run the container

    docker run --rm -it -v \
    /var/run/docker.sock:/var/run/docker.sock \
    -v /yourpath:/.config/jesseduffield/lazydocker \
    lazyteam/lazydocker
    
    • Don't forget to change /yourpath to an actual path you created to store lazydocker's config

    • You can also use this docker-compose.yml

    • 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
      

For development, you can build the image using:

git clone https://github.com/jesseduffield/lazydocker.git
cd lazydocker
docker build -t lazyteam/lazydocker \
    --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
    --build-arg VCS_REF=`git rev-parse --short HEAD` \
    --build-arg VERSION=`git describe --abbrev=0 --tag` \
    .

If you encounter a compatibility issue with Docker bundled binary, try rebuilding the image with the build argument --build-arg DOCKER_VERSION="v$(docker -v | cut -d" " -f3 | rev | cut -c 2- | rev)" so that the bundled docker binary matches your host docker binary version.

Manual

You'll need to install Go

git clone https://github.com/jesseduffield/lazydocker.git
cd lazydocker
go install

You can also use go run main.go to compile and run in one go (pun definitely intended)

Usage

Call lazydocker in your terminal. I personally use this a lot so I've made an alias for it like so:

echo "alias lzd='lazydocker'" >> ~/.zshrc

(you can substitute .zshrc for whatever rc file you're using)

Cool features

everything is one keypress away (or one click away! Mouse support FTW):

lazydocker (jesseduffield/lazydocker)

Searching Database…

这是什么东西?Lazydocker 是一个简单的终端界面,同时支持 docker 和 docker-compose,用 Go 语言和 gocui 库编写——正如它的口号所说,是'管理一切 docker 相关事物的更懒的方式'。
怎么把它装到我的电脑上最快?README 建议添加该项目自己的 Homebrew 仓库(tap)而不是核心仓库,因为它更新更频繁——而且这个 formula 在 Linux 上也能用。装好后在终端里运行 lazydocker 就行了。
我的电脑需要哪个版本的 Docker?要求 Docker >= 29.0.0(API >= 1.24);Docker-Compose >= 1.23.2 是可选的,如果你只管理普通的 docker,没有它也没问题。
我能把 lazydocker 本身跑在 Docker 容器里吗?可以,README 里甚至给出了相应的 docker-compose.yml——但要注意自带的 docker 二进制文件可能存在兼容性问题,重新构建镜像使其与你主机的 docker 版本一致即可解决。
Windows 上能用吗,还是只支持 Mac 和 Linux?Windows 是一等公民:有 Scoop 和 Chocolatey 包,而且发布页同时提供 Linux、OSX 和 Windows 的二进制文件。
为什么不直接用 docker CLI?README 的简短介绍是:记住 docker 命令很难,而在多个终端窗口之间跟踪你的容器更是几乎不可能。Lazydocker 把你需要的一切都放进一个终端窗口,每个常用命令只需按一个键,还支持自定义命令。
在里面我实际能看到和做什么?你可以一眼看清 docker 或 docker-compose 环境的状态,查看任意容器或服务的日志,还能看到容器指标的 ASCII 图表——所有这些只需按一个键或点一下鼠标。
使用它需要安装 Go 吗?日常使用不需要:Homebrew、Scoop、Chocolatey、asdf-vm 和预编译的二进制文件都能直接安装现成的 lazydocker。只有从源码构建时才需要 Go,那时用 go run main.go 就能一步编译并运行。
它免费吗,商业使用也免费吗?是的——GitHub 上 lazydocker 采用 MIT 许可证,你可以自由使用、修改和分发。
What are similar projects?telegraf, sampler, k9s, wtf, ctop, cadvisor, glances, witr
Size
29.5 MB
Stars
53.2K
Age
7y
Commits · 90 Days