297.2. lazydocker-0.25.2
Terminal UI for containers, images and logs
| Version | 0.25.2, release 1 |
| Shelf | containers — Container runtimes, image tools, container networking and sandbox primitives |
| Phase | 44_apps (Applications), 39 of 422 in build order |
| Licence | MIT |
| Homepage | https://github.com/jesseduffield/lazydocker |
| Build time | 0.5 SBU |
| Installed size | 14.6 MiB in 3 files |
| Recipe | ports/core/containers/lazydocker/kpkgbuild |
About
lazydocker is a terminal interface for containers: containers, images, volumes and their logs and statistics on one screen, with single keys for the common actions. It speaks the Docker API, which Podman’s API service also serves, so on KDOS it manages Podman’s containers. It is a Go program built from its vendor bundle, the second sha256 = line (see Vendoring).
Why it is in KDOS
The comment above it in script/phases/44_apps/packages.d/containers.txt:
The container layer is podman and distrobox, and nothing on the console shows a container. lazydocker speaks the Docker API, which
podman system serviceserves over a socket; its entry runs behind kdos-podman-api, which starts that service on demand and names it in $DOCKER_HOST.
Sources
lazydocker-0.25.2.tar.gz(12.6 MiB)
sha256405071220e5be9aa061c65d290e0347143b73ae0a3cc01df164f0105de2b53c4
upstream: https://github.com/jesseduffield/lazydocker/archive/v0.25.2.tar.gz
archive copy: sources-1/containers--lazydocker-0.25.2.tar.gzlazydocker-vendor-0.25.2.tar.xz(1.9 MiB)
sha2565d1f51ff77adc06dcc465cd88a2a57086af2d4765ab9669a25053b732a7aa4a7
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-1/containers--lazydocker-vendor-0.25.2.tar.xz
Dependencies
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install lazydocker'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/containers/lazydocker.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/containers/lazydocker
echo '405071220e5be9aa061c65d290e0347143b73ae0a3cc01df164f0105de2b53c4 lazydocker-0.25.2.tar.gz' | sha256sum -c -
echo '5d1f51ff77adc06dcc465cd88a2a57086af2d4765ab9669a25053b732a7aa4a7 lazydocker-vendor-0.25.2.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/lazydocker
SRC=$SRC_ROOT/lazydocker-0.25.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf lazydocker-0.25.2.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CGO_ENABLED=0
go build -mod=vendor -ldflags "-s -w -X main.version=$version" -o lazydocker
install -Dm755 lazydocker $PKG/usr/bin/lazydocker
install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/lazydocker.desktop" <<'EOF2'
[Desktop Entry]
Type=Application
Name=Containers (lazydocker)
GenericName=Container Manager
Comment=Containers, images, volumes and logs on one screen
Exec=kdos-podman-api lazydocker
Icon=network-server
Terminal=true
Categories=System;
Keywords=docker;podman;container;image;logs;lazydocker;
EOF2
chmod 644 "$PKG/usr/share/applications/lazydocker.desktop"
The switches, and why each is set:
-X main.version=$version— inside the one-ldflagsstring, set the versionlazydocker --versionreports. Upstream’s release builds stamp it the same way (.goreleaser.yml). Unstamped,main.gofalls back to the commit Go records from a git checkout, and the unpacked tarball has none (the tree’sGOFLAGSalso carries-buildvcs=false), so it would reportunversioned.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/lazydocker, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf lazydocker-0.25.2-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/lazydocker, and runs the triggers its paths call for.
Contents
Installed programs: lazydocker.
Installed directories: /usr/share/licenses/lazydocker.
Notes
The menu entry runs kdos-podman-api lazydocker in a terminal. The wrapper starts podman system service when nothing answers on the account’s API socket and points DOCKER_HOST at it; typed at a prompt, lazydocker reaches the socket only while a service is already running. See Containers.