summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker-distribution
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/docker-distribution')
-rw-r--r--recipes-containers/docker-distribution/docker-distribution_git.bb19
-rw-r--r--recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch21
-rw-r--r--recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch45
3 files changed, 64 insertions, 21 deletions
diff --git a/recipes-containers/docker-distribution/docker-distribution_git.bb b/recipes-containers/docker-distribution/docker-distribution_git.bb
index dbca0d55..d831ce5f 100644
--- a/recipes-containers/docker-distribution/docker-distribution_git.bb
+++ b/recipes-containers/docker-distribution/docker-distribution_git.bb
@@ -3,16 +3,17 @@ SUMMARY = "The Docker toolset to pack, ship, store, and deliver content"
3LICENSE = "Apache-2.0" 3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
5 5
6SRCREV_distribution= "d607c6ccb9372e05556624f973119a23d3a42987" 6SRCREV_distribution = "da404778edd3faa665e48ca3bb791b6144f3355e"
7SRC_URI = "git://github.com/docker/distribution.git;branch=release/2.8;name=distribution;destsuffix=git/src/github.com/docker/distribution;protocol=https \ 7SRC_URI = "git://github.com/docker/distribution.git;branch=main;name=distribution;destsuffix=git/src/github.com/distribution/distribution/v3;protocol=https \
8 file://docker-registry.service \ 8 file://docker-registry.service \
9 file://0001-build-use-to-use-cross-go-compiler.patch \ 9 file://0001-build-use-to-use-cross-go-compiler.patch \
10 file://0001-s3-aws-fix-build-for-386.patch \
10 " 11 "
11 12
12PACKAGES =+ "docker-registry" 13PACKAGES =+ "docker-registry"
13 14
14PV = "v2.8.3+git" 15PV = "v3.0.0"
15S = "${WORKDIR}/git/src/github.com/docker/distribution" 16S = "${UNPACKDIR}/git/src/github.com/distribution/distribution/v3"
16 17
17GO_IMPORT = "import" 18GO_IMPORT = "import"
18 19
@@ -20,11 +21,11 @@ inherit goarch go systemd
20 21
21# This disables seccomp and apparmor, which are on by default in the 22# This disables seccomp and apparmor, which are on by default in the
22# go package. 23# go package.
23EXTRA_OEMAKE="BUILDTAGS=''" 24EXTRA_OEMAKE = "BUILDTAGS=''"
24 25
25do_compile() { 26do_compile() {
26 export GOARCH="${TARGET_GOARCH}" 27 export GOARCH="${TARGET_GOARCH}"
27 export GOPATH="${WORKDIR}/git/" 28 export GOPATH="${UNPACKDIR}/git/"
28 export GOROOT="${STAGING_LIBDIR}/go" 29 export GOROOT="${STAGING_LIBDIR}/go"
29 # Pass the needed cflags/ldflags so that cgo 30 # Pass the needed cflags/ldflags so that cgo
30 # can find the needed headers files and libraries 31 # can find the needed headers files and libraries
@@ -39,6 +40,8 @@ do_compile() {
39 40
40 cd ${S} 41 cd ${S}
41 42
43 # See https://github.com/distribution/distribution/issues/4627
44 sed -i -e 's#+unknown##' version/version.go
42 oe_runmake binaries 45 oe_runmake binaries
43} 46}
44 47
@@ -48,7 +51,7 @@ do_install() {
48 51
49 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 52 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
50 install -d ${D}${systemd_unitdir}/system 53 install -d ${D}${systemd_unitdir}/system
51 install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system 54 install -m 644 ${UNPACKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system
52 fi 55 fi
53 56
54 install -d ${D}/${sysconfdir}/docker-distribution/registry/ 57 install -d ${D}/${sysconfdir}/docker-distribution/registry/
@@ -73,5 +76,3 @@ SYSTEMD_AUTO_ENABLE:docker-registry = "enable"
73RDEPENDS:${PN}-ptest:remove = "${PN}" 76RDEPENDS:${PN}-ptest:remove = "${PN}"
74 77
75CVE_PRODUCT = "docker_registry" 78CVE_PRODUCT = "docker_registry"
76
77COMPATIBLE_HOST:riscv64 = "null"
diff --git a/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch b/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch
index f97a60ca..0f00b998 100644
--- a/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch
+++ b/recipes-containers/docker-distribution/files/0001-build-use-to-use-cross-go-compiler.patch
@@ -13,19 +13,16 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
13 Makefile | 2 +- 13 Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-) 14 1 file changed, 1 insertion(+), 1 deletion(-)
15 15
16diff --git a/Makefile b/Makefile 16Index: distribution/Makefile
17index 4635c6ec..a95e860e 100644 17===================================================================
18--- a/Makefile 18--- distribution.orig/Makefile
19+++ b/Makefile 19+++ distribution/Makefile
20@@ -88,7 +88,7 @@ FORCE: 20@@ -60,7 +60,7 @@ version/version.go:
21 # Build a binary from a cmd. 21
22 bin/%: cmd/% FORCE 22 bin/%: cmd/% FORCE ## build individual binary
23 @echo "$(WHALE) $@${BINARY_SUFFIX}" 23 @echo "$(WHALE) $@${BINARY_SUFFIX}"
24- @go build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< 24- @go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS} ./$<
25+ @${GO} build ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$< 25+ @${GO} build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS} ./$<
26 26
27 binaries: $(BINARIES) ## build binaries 27 binaries: $(BINARIES) ## build binaries
28 @echo "$(WHALE) $@" 28 @echo "$(WHALE) $@"
29--
302.19.1
31
diff --git a/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch b/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch
new file mode 100644
index 00000000..4fbae6e4
--- /dev/null
+++ b/recipes-containers/docker-distribution/files/0001-s3-aws-fix-build-for-386.patch
@@ -0,0 +1,45 @@
1From 6970080b10a53d858dd444a643a2bd911de12940 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 29 May 2025 11:28:38 +0800
4Subject: [PATCH] s3-aws: fix build for 386
5
6When building for 386, we got the following build error:
7
8 registry/storage/driver/s3-aws/s3.go:312:99: cannot use
9 maxChunkSize (untyped int constant 5368709120) as int value
10 in argument to getParameterAsInteger (overflows)
11
12This is because the s3_64bit.go is used. Adjust the build tag matching
13in s3_32bit.go and s3_64bit.go to fix this issue.
14
15Upstream-Status: Submitted [https://github.com/distribution/distribution/pull/4642]
16
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18---
19 registry/storage/driver/s3-aws/s3_32bit.go | 2 +-
20 registry/storage/driver/s3-aws/s3_64bit.go | 2 +-
21 2 files changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/registry/storage/driver/s3-aws/s3_32bit.go b/registry/storage/driver/s3-aws/s3_32bit.go
24index 218e3eab..84161fcb 100644
25--- a/registry/storage/driver/s3-aws/s3_32bit.go
26+++ b/registry/storage/driver/s3-aws/s3_32bit.go
27@@ -1,4 +1,4 @@
28-//go:build arm
29+//go:build arm || 386
30
31 package s3
32
33diff --git a/registry/storage/driver/s3-aws/s3_64bit.go b/registry/storage/driver/s3-aws/s3_64bit.go
34index 55254e49..2ed1f92f 100644
35--- a/registry/storage/driver/s3-aws/s3_64bit.go
36+++ b/registry/storage/driver/s3-aws/s3_64bit.go
37@@ -1,4 +1,4 @@
38-//go:build !arm
39+//go:build !arm && !386
40
41 package s3
42
43--
442.34.1
45