blob: 71a88ace25a9d93928324e8dc6cb39de6123f670 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
HOMEPAGE = "http://github.com/docker/distribution"
SUMMARY = "The Docker toolset to pack, ship, store, and deliver content"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
SRCREV_distribution="d7362d7e3a706f3200be70369544094fea3e5b7c"
SRC_URI = "git://github.com/docker/distribution.git;branch=release/2.7;name=distribution;destsuffix=git/src/github.com/docker/distribution \
file://docker-registry.service \
file://0001-build-use-to-use-cross-go-compiler.patch \
"
PACKAGES =+ "docker-registry"
PV = "v2.7.1"
S = "${WORKDIR}/git/src/github.com/docker/distribution"
GO_IMPORT = "import"
inherit goarch
inherit go
# This disables seccomp and apparmor, which are on by default in the
# go package.
EXTRA_OEMAKE="BUILDTAGS=''"
do_compile() {
export GOARCH="${TARGET_GOARCH}"
export GOPATH="${WORKDIR}/git/"
export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export CGO_ENABLED="1"
export CFLAGS=""
export LDFLAGS=""
export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export GO_GCFLAGS=""
export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export GO111MODULE=off
cd ${S}
oe_runmake binaries
}
do_install() {
install -d ${D}/${sbindir}
install ${S}/bin/registry ${D}/${sbindir}
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system
fi
install -d ${D}/${sysconfdir}/docker-distribution/registry/
install ${S}/cmd/registry/config-example.yml ${D}/${sysconfdir}/docker-distribution/registry/config.yml
# storage for the registry containers
install -d ${D}/${localstatedir}/lib/registry/
}
INSANE_SKIP_${PN} += "ldflags already-stripped"
INSANE_SKIP_${MLPREFIX}docker-registry += "ldflags already-stripped textrel"
FILES_docker-registry = "${sbindir}/*"
FILES_docker-registry += "${systemd_unitdir}/system/docker-registry.service"
FILES_docker-registry += "${sysconfdir}/docker-distribution/*"
FILES_docker-registry += "${localstatedir}/lib/registry/"
SYSTEMD_SERVICE_docker-registry = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker-registry.service','',d)}"
SYSTEMD_AUTO_ENABLE_docker-registry = "enable"
RDEPENDS_${PN}-ptest_remove = "${PN}"
CVE_PRODUCT = "docker_registry"
|