distribution/packages/services/docker/moby/package.mk
fewtarius 504523cd47
* Improve support for JELOS as a docker host.
* Move configuration and data to user space (/storage/.config/docker/data).
  * Allow building JELOS as root when in a container (temporary).
* Fix missing fonts when building BASE_ONLY.
* Move debug packages to BASE_ONLY builds.
2023-04-23 01:44:25 +00:00

70 lines
2.1 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="moby"
PKG_VERSION="22.06.0-beta.0"
PKG_SHA256="d0221f0b1c0eda2629ed8b7f08b4ec86e61cf38e0cf699f5bd01a2b662273b87"
PKG_LICENSE="ASL"
PKG_SITE="https://mobyproject.org/"
PKG_URL="https://github.com/moby/moby/archive/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain go:host systemd"
PKG_LONGDESC="Moby is an open-source project created by Docker to enable and accelerate software containerization."
PKG_TOOLCHAIN="manual"
# Git commit of the matching release https://github.com/moby/moby
export PKG_GIT_COMMIT="a89b84221c8560e7a3dee2a653353429e7628424"
PKG_MOBY_BUILDTAGS="daemon \
autogen \
exclude_graphdriver_devicemapper \
exclude_graphdriver_aufs \
exclude_graphdriver_btrfs \
journald"
configure_target() {
go_configure
export LDFLAGS="-w -linkmode external -extldflags -Wl,--unresolved-symbols=ignore-in-shared-libs -extld ${CC}"
# used for docker version
export GITCOMMIT=${PKG_GIT_COMMIT}
export VERSION=${PKG_VERSION}
export BUILDTIME="$(date --utc)"
cat > "${PKG_BUILD}/go.mod" << EOF
module github.com/docker/docker
go 1.18
EOF
GO111MODULE=auto ${GOLANG} mod tidy -modfile 'vendor.mod' -compat 1.18
GO111MODULE=auto ${GOLANG} mod vendor -modfile vendor.mod
bash hack/make/.go-autogen
}
make_target() {
mkdir -p bin
${GOLANG} build -mod=mod -modfile=vendor.mod -v -o bin/docker-proxy -a -ldflags "${LDFLAGS}" ./cmd/docker-proxy
${GOLANG} build -mod=mod -modfile=vendor.mod -v -o bin/dockerd -a -tags "${PKG_MOBY_BUILDTAGS}" -ldflags "${LDFLAGS}" ./cmd/dockerd
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
cp bin/* ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/*
}
post_install() {
mkdir -p ${INSTALL}/etc
ln -sf /storage/.config/docker ${INSTALL}/etc/docker
mkdir -p ${INSTALL}/usr/config/docker
cat <<EOF >${INSTALL}/usr/config/docker/daemon.json
{
"data-root": "/storage/.config/docker/data"
}
EOF
enable_service containerd.service
enable_service docker.service
}