The lazier way to manage everything docker

Overview

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

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

Gif

This Just In: Github Sponsors is matching every donation dollar-for-dollar for the next twelve months so if you're feeling generous consider sponsoring me

Demo

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

  • Docker >= 1.13 (API >= 1.25)
  • Docker-Compose >= 1.23.2 (optional)

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

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 /usr/local/bin directory by default, but it can be changed by setting DIR environment variable.

Go

Required Go version >= 1.8

go get github.com/jesseduffield/lazydocker

Arch Linux AUR

You can install lazydocker using your AUR package manager of choice or by running:

git clone https://aur.archlinux.org/lazydocker.git ~/lazydocker
cd ~/lazydocker
makepkg --install

A development version of the AUR package is also available

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.

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)

  • Basic video tutorial here.
  • List of keybindings here.

Cool features

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

  • viewing the state of your docker or docker-compose container environment at a glance
  • viewing logs for a container/service
  • viewing ascii graphs of your containers' metrics so that you can not only feel but also look like a developer
  • customising those graphs to measure nearly any metric you want
  • attaching to a container/service
  • restarting/removing/rebuilding containers/services
  • viewing the ancestor layers of a given image
  • pruning containers, images, or volumes that are hogging up disk space

Contributing

There is still a lot of work to go! Please check out the contributing guide. For contributor discussion about things not better discussed here in the repo, join the slack channel

Slack

Donate

If you would like to support the development of lazydocker, consider sponsoring me (github is matching all donations dollar-for-dollar for 12 months)

Social

If you want to see what I (Jesse) am up to in terms of development, follow me on twitter or watch me program on twitch

FAQ

How do I edit my config?

By opening lazydocker, clicking on the 'project' panel in the top left, and pressing 'o' (or 'e' if your editor is vim). See Config Docs

How do I get text to wrap in my main panel?

In the future I want to make this the default, but for now there are some CPU issues that arise with wrapping. If you want to enable wrapping, use gui.wrapMainPanel: true

How do you select text?

Because we support mouse events, you will need to hold option while dragging the mouse to indicate you're trying to select text rather than click on something. Alternatively you can disable mouse events via the gui.ignoreMouseEvents config value.

Mac Users: See Issue #190 for other options.

Why can't I see my container's logs?

By default we only show logs from the last hour, so that we're not putting too much strain on the machine. This may be why you can't see logs when you first start lazydocker. This can be overwritten in the config's commandTemplates

If you are running lazydocker in Docker container, it is a know bug, that you can't see logs or CPU usage.

Alternatives

  • docui - Skanehira beat me to the punch on making a docker terminal UI, so definitely check out that repo as well! I think the two repos can live in harmony though: lazydocker is more about managing existing containers/services, and docui is more about creating and configuring them.
  • Portainer - Portainer tries to solve the same problem but it's accessed via your browser rather than your terminal. It also supports docker swarm.
  • See Awesome Docker list for similar tools to work with Docker.
Issues
  • Reworked Dockerfile for a more production oriented usage

    Reworked Dockerfile for a more production oriented usage

    • Added .dockerignore to speed up build context and avoid rebuilding when unecessary
    • Specified Alpine and Go versions as build arguments
    • Specified Go target CPU architecture as build arguments to be able to build for ARM devices
    • Specified base images as build arguments to be able to build for ARM devices
    • Trimmed down size of final image using -a -installsuffix cgo -ldflags="-s -w" go build flags and by copying the statically built binary only to the final image
    • Added clear build and run instructions for the Docker container
    opened by qdm12 36
  • Provide a docker image option

    Provide a docker image option

    A similar tool Dry - https://github.com/moncho/dry - provides the capability to be run using docker itself

    docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST=$DOCKER_HOST moncho/dry

    can you please also provide a docker container for this ?

    opened by sandys 31
  • Logs tab is always empty

    Logs tab is always empty

    Describe the bug The Logs tab is empty for each containers but when I press "m" key, logs appears as well.

    To Reproduce Steps to reproduce the behavior:

    1. Launch lazydocker
    2. Navigate in different containers -> Logs tab is still empty
    3. Press "m" key -> GUI disappears, logs are shown
    4. Press Ctrl+c -> GUI re-appears, Logs tab is still empty

    Expected behaviour Logs tab should display content !

    Desktop (please complete the following information):

    • OS: Debian Stretch
    • Lazydocker Version: docker image lazyteam/lazydocker:version-0.9.1

    docker-compose.yml

    version: '3'
    services:
      lazydocker:
        container_name: lazydocker
        image: lazyteam/lazydocker:version-0.9.1
        build:
          context: https://github.com/jesseduffield/lazydocker.git
          args:
            BASE_IMAGE_BUILDER: golang
            GOARCH: amd64
            GOARM:
        stdin_open: true
        tty: true
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - /var/local/lazydocker/:/.config/jesseduffield/lazydocker
        restart: always
    
    bug 
    opened by benjamin-feron 13
  • Automatically push to dockerhub as part of CI pipeline

    Automatically push to dockerhub as part of CI pipeline

    Is your feature request related to a problem? Please describe. It would be cool if we built the lazydocker image and pushed to docker hub as part of the CI pipeline when we do a release

    enhancement 
    opened by jesseduffield 13
  • Show Project Directory in Status Panel

    Show Project Directory in Status Panel

    As per this discussion, this puts the current working directory name into the Status Panel area. As related changes, this PR also moves the "lazydocker" project name down to the information area, and renames the Status Panel to the "Project Panel" (which seemed a natural consequence).

    opened by pvande 11
  • Map the aarch64 platform to the arm64 binary

    Map the aarch64 platform to the arm64 binary

    Fixes #83

    The solution is to check if uname -m is aarch64, then it should be arm64 in the URL.

    If we need to map more platforms later, we can introduce a simple case...esac check to handle the different outputs of uname -m.

    opened by immanuelfodor 11
  • Missing container information

    Missing container information

    Describe the bug After the last Docker Update on Mac OS, all the information on the right side of lazydocker are not visible anymore.

    To Reproduce Just open lazydocker with the latest Docker Version (2.3.0.5).

    Screenshots screenshot

    Desktop:

    • OS: MacOS 10.15.6
    • Lazydocker Version 0.9.1
    bug 
    opened by teawithfruit 10
  • High CPU usage by Docker for Mac when lazydocker is running idle

    High CPU usage by Docker for Mac when lazydocker is running idle

    Describe the bug When running lazydocker on my Mac (latest version), while no containers are running, Docker for Mac uses ~25-30% cpu.

    To Reproduce Steps to reproduce the behavior:

    1. Start lazydocker
    2. Open Activity Monitor in CPU tab
    3. Find process com.docker.hyperkit
    4. See CPU usage

    Expected behaviour CPU usage low (without lazydocker it's ~2%). Maybe small impact.

    Screenshots NA

    Desktop (please complete the following information):

    • OS: Mac OS (latest as of July 7th 2019).
    • Lazydocker Version Version: commit=a536c09dab90fc9a4f4931285466d6126c8bc121, build date=2019-07-05T10:59:26Z, build source=binaryRelease, version=0.5.4, os=darwin, arch=amd64
    • The last commit id if you built project from sources (run : git rev-parse HEAD)

    Additional context I assume the load is due to continuous querying of the Docker API. Might be a good idea to allow setting the polling interval so I can choose to config a lower polling rate and reduce the load on Docker.

    bug 
    opened by eldada 10
  • Added `e` keybinding for toggling visibility stopped containers

    Added `e` keybinding for toggling visibility stopped containers

    This is a suggested fix for #110
    @jesseduffield I've added an translation struct item to the TranslationSet but i'm not sure what to do next, shall i add it manually add it to every translation file and keybindings readme file or can that be dune semi automated?

    opened by mjarkk 10
  • integration own commands

    integration own commands

    Hello,

    i start the lazydocker with:

    docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v c:/test/lazydocker:/.config/jesseduffield/lazydocker lazyteam/lazydocker

    Under ' c:/test/lazydocker' is the lazydocker project. For example the config.yml .


    gui: scrollHeight: 2 theme: activeBorderColor: - red - bold inactiveBorderColor: - green optionsTextColor: - white reporting: "on" commandTemplates: restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}' dockerCompose: docker-compose stopService: '{{ .DockerCompose }} stop {{ .Service.Name }}' serviceLogs: '{{ .DockerCompose }} logs --since=60m --follow {{ .Service.Name }}' viewServiceLogs: '{{ .DockerCompose }} logs --follow {{ .Service.Name }}' rebuildService: '{{ .DockerCompose }} up -d --build {{ .Service.Name }}' recreateService: '{{ .DockerCompose }} up -d --force-recreate {{ .Service.Name }}' viewContainerLogs: docker logs --timestamps --follow --since=60m {{ .Container.ID }} containerLogs: docker logs --timestamps --follow --since=60m {{ .Container.ID }} allLogs: '{{ .DockerCompose }} logs --tail=300 --follow' viewAlLogs: '{{ .DockerCompose }} logs' dockerComposeConfig: '{{ .DockerCompose }} config' checkDockerComposeConfig: '{{ .DockerCompose }} config --quiet' serviceTop: '{{ .DockerCompose }} top {{ .Service.Name }}' customCommands: containers:

    • name: bash attach: true command: docker exec -it {{ .Container.ID }} /bin/sh serviceNames: [] oS: openCommand: open {{filename}} openLinkCommand: open {{link}} update: dockerRefreshInterval: 100ms stats: graphs:
    • caption: CPU (%) statPath: DerivedStats.CPUPercentage color: blue
    • caption: Memory (%) statPath: DerivedStats.MemoryPercentage color: green

    Is there a way to define in the config.yml my own commands ?

    I work under windows 10 and docker desktop.

    discussion 
    opened by StephanKrauss 9
  • Add automated install-update steps for Linux

    Add automated install-update steps for Linux

    Hi, I've added a small code snippet to be able to download and install/update the binary file without manual steps. Tested on Ubuntu and Manjaro Linux distros. Also improved the clickability of the release link.

    opened by immanuelfodor 9
  • Add Compose V2 instructions to FAQ

    Add Compose V2 instructions to FAQ

    Just ran into this when setting up a new environment with Compose V2. As Compose V1 is now deprecated, perhaps lazydocker should default to the new docker compose command? Could be too soon to make this change though, as many people are still using older versions of docker that don't have Compose V2 support.

    opened by Syriiin 0
  • Add Keybindings_fr.md

    Add Keybindings_fr.md

    Add french translation for the keybindings doc.

    In the CONTRIBUTING.md it is written that one should first discuss with the author before contributing, but considering how basic adding a translation to docs is, I assumed I could directly go for a PR.

    Please decline the PR if the changes are unwanted.

    Regards.

    opened by clemsau 0
  • Custom command passing a string literal

    Custom command passing a string literal

    Describe the bug Running an ad hoc docker run command in the terminal works. Passing the same command to lazydocker as either a scalar (folded/literal) or inline fails.

    To Reproduce Steps to reproduce the behavior:

    1. Create a custom command in config.yml
      - name: run-meetup
        attach: true
        command: >
          docker run -it --name meetup_bot
          -p 80:3000
          -e PORT="3000"
          -v "$(pwd)":/home/appuser/app
          --env-file .env
          meetup_bot
          bash
      

      or

      - name: run-meetup
        attach: true
        command: 'docker run -it --name meetup_bot -p 80:3000 -e PORT="3000" -v "$(pwd)":/home/appuser/app --env-file .env meetup_bot bash'
      
    2. Open lazydocker
    3. Run the command
    4. Raises error:
      + docker run -it --name meetup_bot -p 80:3000 -e PORT=3000 -v $(pwd):/home/appuser/app --env-file .env meetup_bot bash
      
      docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
      See 'docker run --help'.
      

    Expected behaviour It should interpolate/expand the pwd command or $PWD built-in variable in the command. Only able to hard-code the absolute path to work around the issue. Less than ideal, of course.

    Screenshots N/A

    Desktop (please complete the following information):

    • OS: macOS 12.4 (21F79)
    • Lazydocker Version: v0.18.1
    • The last commit id if you built project from sources: N/A

    Additional context Using the new docker mount syntax got the same results.

    bug 
    opened by pythoninthegrass 0
  • Docker Desktop Extension?

    Docker Desktop Extension?

    Describe the solution you'd like With the open beta of Docker Desktop Extensions, have you considered extending this fantastic UI to also run on Docker Desktop? It's a far stretch I imagine, and I wouldn't hold it against you if you said it was outside the scope of the project.

    enhancement 
    opened by FantasticFiasco 0
  • Include image name on config tab

    Include image name on config tab

    Sometimes the container image names can be cut off by long container names, for example in https://github.com/jesseduffield/lazydocker/issues/263.

    This PR add the container name on the config tab:

    Screenshot from 2022-06-03 17-13-14

    opened by rmtsrc 0
  • lazydocker with docker-desktop

    lazydocker with docker-desktop

    I install docker-desktop for linux, but I love lazydocker because I like controlling docker in the terminal. How to connect lazydocker with docker-desktop?

    https://docs.docker.com/desktop/linux/install/#differences-between-docker-desktop-for-linux-and-docker-engine

    enhancement 
    opened by thevan96 0
Releases(v0.18.1)
Owner
Jesse Duffield
Creator of lazygit, lazydocker, and horcrux.
Jesse Duffield
sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC), and Everything as Code. So it is a tool for DevOps.

sail 中文文档 sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC),a

Bougou Nisou 10 Dec 16, 2021
Jenkins CLI allows you manage your Jenkins as an easy way

Quick start 简体中文 Jenkins CLI Jenkins CLI allows you manage your Jenkins in an easy way. No matter if you're a plugin developer, administrator or just

Jenkins Chinese Community 326 Jun 23, 2022
Go project to manage an ubuntu docker container

Go-docker-manager This project consist of a Go app that connects to a Docker backend, spans a Ubuntu container and shows live CPU/Memory information f

Miguel Sama 1 Oct 27, 2021
Explore Docker registries and manipulate Docker images!

L/S tags Utility and API to manipulate (analyze, synchronize and aggregate) images across different Docker registries. Example invocation $ lstags alp

Ivan Ilves 288 Jun 15, 2022
Docker-based remote code runner / 基于 Docker 的远程代码运行器

Docker-based remote code runner / 基于 Docker 的远程代码运行器

E99p1ant 35 Feb 22, 2022
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)

English / 日本語 ecsk ECS + Task = ecsk ?? ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run

null 101 Jun 20, 2022
Hassle-free minimal CI/CD for git repositories with docker or docker-compose projects.

GIT-PIPE Hassle-free minimal CI/CD for git repos for docker-based projects. Features: zero configuration for repos by default automatic encrypted back

Aleksandr Baryshnikov 51 Oct 8, 2021
Tool to convert docker-compose files to set of simple docker commands

docker-decompose Tool to convert docker-compose files to set of simple docker commands. Install Use go get to install the latest version of the librar

Liri S 2 Apr 12, 2022
Go-http-server-docker - Simple sample server using docker and go

go-http-server-docker Simple sample webserver using docker and go.

null 0 Jan 8, 2022
Docker-hub-rate-limit - Show pulling rate status of Docker-hub

Docker-Hub Pull Rate Status This tool shows current status of docker hub pull ra

Tak 1 Jan 28, 2022
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Daniel Dias de Assumpção 5 Jun 13, 2022
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Daniel Dias de Assumpção 1 Feb 16, 2022
Manage your ssh alias configs easily.

manssh manssh is a command line tool for managing your ssh alias config easily, inspired by storm project, powered by Go. Note: This project is actual

Wendell Sun 266 Jun 20, 2022
Manage Go Versions/Projects/Dependencies

rodent rodent is a shell (bash) application which: Manages multiple versions of Go. Allows you to test/build your projects against multiple Go release

Ali Abbas 32 May 31, 2022
Modular Kubernetes operator to manage the lifecycle of databases

Ensemble Ensemble is a simple and modular Kubernetes Operator to manage the lifecycle of a wide range of databases. Infrastructure as code with Kubern

Tesera 42 Mar 1, 2022
🐶 Kubernetes CLI To Manage Your Clusters In Style!

K9s - Kubernetes CLI To Manage Your Clusters In Style! K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project i

Fernand Galiana 16.8k Jun 23, 2022
Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.

Open Service Mesh (OSM) Open Service Mesh (OSM) is a lightweight, extensible, Cloud Native service mesh that allows users to uniformly manage, secure,

Open Service Mesh 2.4k Jun 24, 2022
Manage large fleets of Kubernetes clusters

Introduction Fleet is GitOps at scale. Fleet is designed to manage up to a million clusters. It's also lightweight enough that it works great for a si

Rancher 1.2k Jun 28, 2022
Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.

gobrew Go version manager Install or update With curl $ curl -sLk https://git.io/gobrew | sh - or with go $ go get -u github.com/kevincobain2000/gobre

Pulkit Kathuria 102 Jun 7, 2022