app-containers/zot - 2.1.21 (local-ai)

Search

Install

Install this version:

emerge -a =app-containers/zot-2.1.21

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =app-containers/zot-2.1.21

Or alternatively:

emerge --autounmask-write -a =app-containers/zot-2.1.21

Package Information

Description:
OCI-native container image registry
Homepage:
https://zotregistry.dev https://github.com/project-zot/zot
License:
Apache-2.0

Ebuild Details

Version EAPI Keywords Slot
2.1.21 8 ~amd64 0
View Raw Ebuild
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# zot is an OCI-native container image registry. Pure Go, built with the
# upstream-default extension set as build tags; the optional web interface
# (the zui React app, pinned by upstream) is built from source and
# embedded into the binary.

EAPI=8

inherit check-reqs go-module systemd

# The dependency tarballs live as release assets on this repository,
# tagged zot-v<version>.
ZOT_DISTFILES="https://git.ipnmod.org/packages/local-ai-overlay/releases/download/zot-v${PV}"

# The zui tag zot's Makefile pins (ZUI_VERSION).
ZUI_PIN="commit-a7feb46"

DESCRIPTION="OCI-native container image registry"
HOMEPAGE="https://zotregistry.dev https://github.com/project-zot/zot"
SRC_URI="
	https://github.com/project-zot/zot/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${ZOT_DISTFILES}/${P}-deps.tar.xz
	ui? (
		https://github.com/project-zot/zui/archive/refs/tags/${ZUI_PIN}.tar.gz -> zui-${ZUI_PIN}.tar.gz
		${ZOT_DISTFILES}/${P}-zui-node_modules.tar.xz
	)
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+ui"

RDEPEND="
	acct-group/zot
	acct-user/zot
"
BDEPEND="
	>=dev-lang/go-1.26.4
	ui? ( net-libs/nodejs[npm] )
"

CHECKREQS_DISK_BUILD="10G"

pkg_pretend() {
	check-reqs_pkg_pretend
}

pkg_setup() {
	check-reqs_pkg_setup
}

src_prepare() {
	default

	# The node_modules tarball unpacks at the WORKDIR top level; move it
	# into the zui tree where npm expects it.
	if use ui; then
		mv "${WORKDIR}/node_modules" "${WORKDIR}/zui-${ZUI_PIN}/node_modules" || die
	fi

	# trivy (v0.74.0 at this zot release) uses the experimental json/v2
	# SkipFunc sentinel, which go 1.27's graduated encoding/json/v2
	# removed; upstream fix is aquasecurity/trivy@dc3c56ee (still in no
	# trivy release) and replaces it with errors.ErrUnsupported. Apply
	# the same change to every affected file in the module cache copy
	# (extracted trees are not re-verified against go.sum).
	if has_version -b ">=dev-lang/go-1.27"; then
		local f found=
		while IFS= read -r -d '' f; do
			found=1
			chmod u+w "${f%/*}" "${f}" || die
			sed -i -e 's:json\.SkipFunc:errors.ErrUnsupported:g' "${f}" || die
			grep -q '"errors"' "${f}" || \
				sed -i -e '0,/^import (/s:^import (:import (\n\t"errors":' "${f}" || die
		done < <(grep -rlZ 'json\.SkipFunc' "${WORKDIR}"/go-mod/github.com/aquasecurity/trivy@v*)
		[[ -n ${found} ]] || die "trivy json/v2 fix did not apply"
	fi
}

src_compile() {
	# Upstream's default extension set (Makefile EXTENSIONS), minus/plus
	# the ui tag depending on the flag.
	local tags="sync,search,scrub,metrics,lint,mgmt,profile,userprefs,imagetrust,events"

	if use ui; then
		einfo "Building the zui web interface"
		pushd "${WORKDIR}/zui-${ZUI_PIN}" >/dev/null || die
		npm run build || die "zui build failed"
		popd >/dev/null || die
		rm -rf pkg/extensions/build
		cp -R "${WORKDIR}/zui-${ZUI_PIN}/build" pkg/extensions/build || die
		tags+=",ui"
	fi

	# Mirrors upstream's `make binary` invocation, minus -s -w: stripping
	# is Portage's job. zot targets go 1.27's encoding/json/v2 — still an
	# experiment on go 1.26, graduated (and an unknown flag) on 1.27+.
	local ldflags=(
		-X "zotregistry.dev/zot/v2/pkg/buildinfo.ReleaseTag=v${PV}"
		-X "zotregistry.dev/zot/v2/pkg/buildinfo.Commit=v${PV}"
		-X "zotregistry.dev/zot/v2/pkg/buildinfo.BinaryType=-${tags//,/-}"
		-X "zotregistry.dev/zot/v2/pkg/buildinfo.GoVersion=$(go env GOVERSION)"
	)
	local -x CGO_ENABLED=0
	if ! has_version -b ">=dev-lang/go-1.27"; then
		local -x GOEXPERIMENT=jsonv2
	fi
	ego build -tags "${tags}" -trimpath -ldflags "${ldflags[*]}" -o zot ./cmd/zot
}

src_install() {
	dobin zot

	insinto /etc/zot
	if use ui; then
		newins "${FILESDIR}"/config-ui.json config.json
	else
		doins "${FILESDIR}"/config.json
	fi

	newinitd "${FILESDIR}"/zot.initd zot
	newconfd "${FILESDIR}"/zot.confd zot
	systemd_dounit "${FILESDIR}"/zot.service

	insinto /etc/logrotate.d
	newins "${FILESDIR}"/zot.logrotate zot

	# Image storage (storage.rootDirectory in the config).
	keepdir /var/lib/zot
	fowners zot:zot /var/lib/zot
}

pkg_postinst() {
	elog "The registry listens on 127.0.0.1:5000 and stores images under"
	elog "/var/lib/zot; adjust /etc/zot/config.json before serving other"
	elog "hosts (authentication is not configured by default)."
}

USE Flags

Manage flags for this package: euse -i <flag> -p app-containers/zot | euse -E <flag> -p app-containers/zot | euse -D <flag> -p app-containers/zot

Global/Standard Flags

ui
Default: Enabled (+)

Inherited Eclasses

Dependencies

RDEPEND

	acct-group/zot
	acct-user/zot

BDEPEND

	>=dev-lang/go-1.26.4
	ui? ( net-libs/nodejs[npm] )

Manifest for 2.1.21

Type File Size Source URLs
DIST zot-2.1.21-deps.tar.xz 1004391184 bytes https://git.ipnmod.org/packages/local-ai-overlay/releases/download/zot-v2.1.21/zot-2.1.21-deps.tar.xz
DIST zot-2.1.21-zui-node_modules.tar.xz 24972192 bytes https://git.ipnmod.org/packages/local-ai-overlay/releases/download/zot-v2.1.21/zot-2.1.21-zui-node_modules.tar.xz
DIST zot-2.1.21.tar.gz 1728812 bytes https://github.com/project-zot/zot/archive/refs/tags/v2.1.21.tar.gz
DIST zui-commit-a7feb46.tar.gz 927757 bytes https://github.com/project-zot/zui/archive/refs/tags/commit-a7feb46.tar.gz