summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/docker')
-rw-r--r--recipes-containers/docker/README.rootless39
-rw-r--r--recipes-containers/docker/docker-moby_git.bb16
-rw-r--r--recipes-containers/docker/docker.inc21
-rw-r--r--recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch56
-rw-r--r--recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch14
-rw-r--r--recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch63
6 files changed, 118 insertions, 91 deletions
diff --git a/recipes-containers/docker/README.rootless b/recipes-containers/docker/README.rootless
new file mode 100644
index 00000000..973d72e9
--- /dev/null
+++ b/recipes-containers/docker/README.rootless
@@ -0,0 +1,39 @@
1 1 docker pull alpine
2 2 cd /var/lib/containers/storage/
3 3 ll
4 4 ls
5 5 ls -alF
6 6 ls overlay
7 7 ls overlay/
8 8 ls overlay/d4fc045c9e3a848011de66f34b81f052d4f2c15a17bb196d637e526349601820/
9 9 ll
10 10 ls -alF
11 11 cd ..
12 12 ls -alF
13 13 ls cache/
14 14 cd storage/
15 15 ll
16 16 ls alF
17 17 ls -alF
18 18 ls
19 19 cd
20 20 skopeo
21 21 ls /var/lib/docker/
22 22 ls /var/lib/docker/
23 23 cd /var/lib/docker/
24 24 ll
25 25 alias ll="ls -alF"
26 26 ll
27 27 ls containers/
28 28 ls overlay2/
29 29 skopeo --help
30 30 skopeo copy
31 31 docker images
32 32 cd
33 33 skopeo copy docker-daemon:alpine oci:alpine
34 34 skopeo copy docker-daemon:alpine:latest oci:alpine
35 35 ls alpine/
36 36 skopeo copy oci:alpine docker-daemon:bruce:latest
37 37 docker images
38 38 docker run -it bruce /bin/sh
39
diff --git a/recipes-containers/docker/docker-moby_git.bb b/recipes-containers/docker/docker-moby_git.bb
index 0abb0b3f..dfbfa706 100644
--- a/recipes-containers/docker/docker-moby_git.bb
+++ b/recipes-containers/docker/docker-moby_git.bb
@@ -44,18 +44,16 @@ DESCRIPTION = "Linux container runtime \
44# so we get that tag, and make it our SRCREVS: 44# so we get that tag, and make it our SRCREVS:
45# 45#
46 46
47SRCREV_moby = "f417435e5f6216828dec57958c490c4f8bae4f98" 47SRCREV_moby = "bbd0a17ccc67e48d4a69393287b7fcc4f0578683"
48SRCREV_libnetwork = "67e0588f1ddfaf2faf4c8cae8b7ea2876434d91c" 48SRCREV_cli = "068a01ea9470df6494cc92d9e64e240805ae47a7"
49SRCREV_cli = "01f933261885c0126edb3f47fd56d048ae31265a" 49SRCREV_FORMAT = "moby"
50SRCREV_FORMAT = "moby_libnetwork"
51SRC_URI = "\ 50SRC_URI = "\
52 git://github.com/moby/moby.git;branch=25.0;name=moby;protocol=https \ 51 git://github.com/moby/moby.git;nobranch=1;name=moby;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \
53 git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork;protocol=https \ 52 git://github.com/docker/cli;nobranch=1;name=cli;destsuffix=git/cli;protocol=https \
54 git://github.com/docker/cli;branch=25.0;name=cli;destsuffix=git/cli;protocol=https \
55 file://docker.init \ 53 file://docker.init \
56 file://0001-libnetwork-use-GO-instead-of-go.patch \
57 file://0001-cli-use-external-GO111MODULE-and-cross-compiler.patch \ 54 file://0001-cli-use-external-GO111MODULE-and-cross-compiler.patch \
58 file://0001-dynbinary-use-go-cross-compiler.patch;patchdir=src/import \ 55 file://0001-dynbinary-use-go-cross-compiler.patch;patchdir=src/import \
56 file://0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch;patchdir=src/import \
59 " 57 "
60 58
61DOCKER_COMMIT = "${SRCREV_moby}" 59DOCKER_COMMIT = "${SRCREV_moby}"
@@ -66,7 +64,7 @@ require docker.inc
66LICENSE = "Apache-2.0" 64LICENSE = "Apache-2.0"
67LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" 65LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
68 66
69DOCKER_VERSION = "25.0.3" 67DOCKER_VERSION = "28.0.1"
70PV = "${DOCKER_VERSION}+git${SRCREV_moby}" 68PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
71 69
72CVE_PRODUCT = "docker mobyproject:moby" 70CVE_PRODUCT = "docker mobyproject:moby"
diff --git a/recipes-containers/docker/docker.inc b/recipes-containers/docker/docker.inc
index 48f7d3ec..05a14f97 100644
--- a/recipes-containers/docker/docker.inc
+++ b/recipes-containers/docker/docker.inc
@@ -36,17 +36,21 @@ GO_IMPORT = "import"
36S = "${WORKDIR}/git" 36S = "${WORKDIR}/git"
37 37
38 38
39
39inherit systemd update-rc.d 40inherit systemd update-rc.d
40inherit go 41inherit go
41inherit goarch 42inherit goarch
42inherit pkgconfig 43inherit pkgconfig
43 44
45REQUIRED_DISTRO_FEATURES ?= "seccomp ipv6"
46inherit features_check
47
44do_configure[noexec] = "1" 48do_configure[noexec] = "1"
45 49
46# Export for possible use in Makefiles, default value comes from go.bbclass 50# Export for possible use in Makefiles, default value comes from go.bbclass
47export GO_LINKSHARED 51export GO_LINKSHARED
48 52
49DOCKER_PKG="github.com/docker/docker" 53DOCKER_PKG = "github.com/docker/docker"
50# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 54# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
51BUILD_TAGS ?= "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper" 55BUILD_TAGS ?= "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
52 56
@@ -60,8 +64,7 @@ do_compile() {
60 ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" 64 ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
61 65
62 mkdir -p .gopath/src/github.com/docker 66 mkdir -p .gopath/src/github.com/docker
63 ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork 67 ln -sf ${S}/cli .gopath/src/github.com/docker/cli
64 ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli
65 68
66 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor" 69 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor"
67 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" 70 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
@@ -90,17 +93,13 @@ do_compile() {
90 export LDFLAGS="" 93 export LDFLAGS=""
91 export DOCKER_VERSION=${DOCKER_VERSION} 94 export DOCKER_VERSION=${DOCKER_VERSION}
92 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${DOCKER_COMMIT}" make dynbinary 95 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${DOCKER_COMMIT}" make dynbinary
93
94 # build the proxy
95 cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork
96 oe_runmake cross-local
97} 96}
98 97
99do_install() { 98do_install() {
100 mkdir -p ${D}/${bindir} 99 mkdir -p ${D}/${bindir}
101 cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker 100 cp ${S}/cli/build/docker ${D}/${bindir}/docker
102 cp ${S}/src/import/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd 101 cp ${S}/src/import/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
103 cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy 102 cp ${S}/src/import/bundles/dynbinary-daemon/docker-proxy ${D}/${bindir}/docker-proxy
104 103
105 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 104 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
106 install -d ${D}${systemd_unitdir}/system 105 install -d ${D}${systemd_unitdir}/system
@@ -110,7 +109,7 @@ do_install() {
110 rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm 109 rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm
111 else 110 else
112 install -d ${D}${sysconfdir}/init.d 111 install -d ${D}${sysconfdir}/init.d
113 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init 112 install -m 0755 ${UNPACKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
114 fi 113 fi
115 # TLS key that docker creates at run-time if not found is what resides here 114 # TLS key that docker creates at run-time if not found is what resides here
116 if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then 115 if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
@@ -126,7 +125,7 @@ do_install() {
126 125
127 126
128SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" 127SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
129SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.socket','',d)}" 128SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service docker.socket','',d)}"
130SYSTEMD_AUTO_ENABLE:${PN} = "enable" 129SYSTEMD_AUTO_ENABLE:${PN} = "enable"
131 130
132# inverted logic warning. We ony want the sysvinit init to be installed if systemd 131# inverted logic warning. We ony want the sysvinit init to be installed if systemd
diff --git a/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch b/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch
new file mode 100644
index 00000000..30b1a7d8
--- /dev/null
+++ b/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch
@@ -0,0 +1,56 @@
1From 28c115da3c6c2e6edda08c30a779f1ffaab2fbc7 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Fri, 18 Oct 2024 18:27:16 +0000
4Subject: [PATCH] check-config: make CONFIG_MEMCG_SWAP conditional
5
6Kernel's equal to or greater than 6.1 no longer have this
7option. See this kernel commit:
8
9 commit e55b9f96860f6c6026cff97966a740576285e07b
10 Author: Johannes Weiner <hannes@cmpxchg.org>
11 Date: Mon Sep 26 09:57:04 2022 -0400
12
13 mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol
14
15 Since 2d1c498072de ("mm: memcontrol: make swap tracking an integral part
16 of memory control"), CONFIG_MEMCG_SWAP hasn't been a user-visible config
17 option anymore, it just means CONFIG_MEMCG && CONFIG_SWAP.
18
19 Update the sites accordingly and drop the symbol.
20
21 [ While touching the docs, remove two references to CONFIG_MEMCG_KMEM,
22 which hasn't been a user-visible symbol for over half a decade. ]
23
24 Link: https://lkml.kernel.org/r/20220926135704.400818-5-hannes@cmpxchg.org
25 Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
26 Acked-by: Shakeel Butt <shakeelb@google.com>
27 Cc: Hugh Dickins <hughd@google.com>
28 Cc: Michal Hocko <mhocko@suse.com>
29 Cc: Roman Gushchin <roman.gushchin@linux.dev>
30 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
31
32Upstream-Status: Inappropriate [embedded specific]
33
34Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
35---
36 contrib/check-config.sh | 4 +++-
37 1 file changed, 3 insertions(+), 1 deletion(-)
38
39diff --git a/contrib/check-config.sh b/contrib/check-config.sh
40index b9cc6bf87d..3124548d99 100755
41--- a/contrib/check-config.sh
42+++ b/contrib/check-config.sh
43@@ -266,7 +266,9 @@ echo 'Optional Features:'
44 check_flags CGROUP_PIDS
45 }
46 {
47- check_flags MEMCG_SWAP
48+ if [ "$kernelMajor" -lt 6 ] || [ "$kernelMajor" -eq 6 -a "$kernelMinor" -le 1 ]; then
49+ check_flags MEMCG_SWAP
50+ fi
51 # Kernel v5.8+ removes MEMCG_SWAP_ENABLED.
52 if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -le 8 ]; then
53 CODE=${EXITCODE}
54--
552.39.2
56
diff --git a/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch b/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
index 160a3bca..9079d81e 100644
--- a/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
+++ b/recipes-containers/docker/files/0001-dynbinary-use-go-cross-compiler.patch
@@ -48,7 +48,7 @@ Index: import/hack/make/.binary
48 echo -n '.exe' 48 echo -n '.exe'
49 fi 49 fi
50 } 50 }
51@@ -16,33 +16,12 @@ 51@@ -16,31 +16,10 @@
52 ( 52 (
53 export GOGC=${DOCKER_BUILD_GOGC:-1000} 53 export GOGC=${DOCKER_BUILD_GOGC:-1000}
54 54
@@ -73,17 +73,15 @@ Index: import/hack/make/.binary
73- fi 73- fi
74- fi 74- fi
75- 75-
76 # -buildmode=pie is not supported on Windows arm64 and Linux mips*, ppc64be
77 # https://github.com/golang/go/blob/go1.19.4/src/cmd/internal/sys/supported.go#L125-L132
78 if ! [ "$DOCKER_STATIC" = "1" ]; then 76 if ! [ "$DOCKER_STATIC" = "1" ]; then
79 # -buildmode=pie not supported when -race is enabled 77 # -buildmode=pie not supported when -race is enabled
80 if [[ " $BUILDFLAGS " != *" -race "* ]]; then 78 if [[ " $BUILDFLAGS " != *" -race "* ]]; then
81- case "$(go env GOOS)/$(go env GOARCH)" in 79- case "$(go env GOOS)/$(go env GOARCH)" in
82+ case "$(${GO} env GOOS)/$(${GO} env GOARCH)" in 80+ case "$(${GO} env GOOS)/$(${GO} env GOARCH)" in
83 windows/arm64 | linux/mips* | linux/ppc64) ;; 81 linux/mips* | linux/ppc64)
84 *) 82 # -buildmode=pie is not supported on Linux mips*, ppc64be
85 BUILDFLAGS+=("-buildmode=pie") 83 # https://github.com/golang/go/blob/go1.23.0/src/internal/platform/supported.go#L189-L197
86@@ -66,11 +45,11 @@ 84@@ -67,11 +46,11 @@
87 # only necessary for non-sandboxed invocation where TARGETPLATFORM is empty 85 # only necessary for non-sandboxed invocation where TARGETPLATFORM is empty
88 PLATFORM_NAME=$TARGETPLATFORM 86 PLATFORM_NAME=$TARGETPLATFORM
89 if [ -z "$PLATFORM_NAME" ]; then 87 if [ -z "$PLATFORM_NAME" ]; then
@@ -100,7 +98,7 @@ Index: import/hack/make/.binary
100 fi 98 fi
101 fi 99 fi
102 100
103@@ -82,7 +61,7 @@ 101@@ -95,7 +74,7 @@
104 if [ -n "$DOCKER_DEBUG" ]; then 102 if [ -n "$DOCKER_DEBUG" ]; then
105 set -x 103 set -x
106 fi 104 fi
diff --git a/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch b/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch
deleted file mode 100644
index f94f73e4..00000000
--- a/recipes-containers/docker/files/0001-libnetwork-use-GO-instead-of-go.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 04c07804930faad708218a3134c81de06a9c742a Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Fri, 6 Apr 2018 23:58:22 -0400
4Subject: [PATCH] libnetwork: use $(GO) instead of go
5
6Ensure that the libnetwork makefile uses the go cross flags and
7utilities.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
12---
13 Makefile | 14 +++++++-------
14 1 file changed, 7 insertions(+), 7 deletions(-)
15
16Index: git/libnetwork/Makefile
17===================================================================
18--- git.orig/libnetwork/Makefile
19+++ git/libnetwork/Makefile
20@@ -45,10 +45,10 @@
21 build-local:
22 @echo "🐳 $@"
23 @mkdir -p "bin"
24- GO111MODULE=off go build -tags experimental -o "bin/dnet" ./cmd/dnet
25- GO111MODULE=off go build -o "bin/docker-proxy" ./cmd/proxy
26- CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic
27- CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go
28+ GO111MODULE=off $(GO) build -trimpath -tags experimental -o "bin/dnet" ./cmd/dnet
29+ GO111MODULE=off $(GO) build -trimpath -o "bin/docker-proxy" ./cmd/proxy
30+ CGO_ENABLED=0 $(GO) build -trimpath -o "bin/diagnosticClient" ./cmd/diagnostic
31+ CGO_ENABLED=0 $(GO) build -trimpath -o "bin/testMain" ./cmd/networkdb-test/testMain.go
32
33 build-images:
34 @echo "🐳 $@"
35@@ -82,8 +82,8 @@
36
37 cross-local:
38 @echo "🐳 $@"
39- GO111MODULE=off go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet
40- GO111MODULE=off go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy
41+ GO111MODULE=off $(GO) build -trimpath $(GO_LINKSHARED) $(GOBUILDFLAGS) -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet
42+ GO111MODULE=off $(GO) build -trimpath $(GO_LINKSHARED) $(GOBUILDFLAGS) -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy
43
44 # Rebuild protocol buffers.
45 # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt.
46@@ -130,7 +130,7 @@
47 if ls $$dir/*.go &> /dev/null; then \
48 pushd . &> /dev/null ; \
49 cd $$dir ; \
50- go test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \
51+ $(GO) test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \
52 ret=$$? ;\
53 if [ $$ret -ne 0 ]; then exit $$ret; fi ;\
54 popd &> /dev/null; \
55@@ -145,7 +145,7 @@
56 # Depends on binaries because vet will silently fail if it can not load compiled imports
57 vet: ## run go vet
58 @echo "🐳 $@"
59- @test -z "$$(go vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)"
60+ @test -z "$$($(GO) vet ${PACKAGES} 2>&1 | grep -v 'constant [0-9]* not a string in call to Errorf' | egrep -v '(timestamp_test.go|duration_test.go|exit status 1)' | tee /dev/stderr)"
61
62 misspell:
63 @echo "🐳 $@"