diff options
Diffstat (limited to 'recipes-containers/docker/docker-ce')
6 files changed, 321 insertions, 0 deletions
diff --git a/recipes-containers/docker/docker-ce/0001-cli-use-go-cross-compiler.patch b/recipes-containers/docker/docker-ce/0001-cli-use-go-cross-compiler.patch new file mode 100644 index 00000000..d9924112 --- /dev/null +++ b/recipes-containers/docker/docker-ce/0001-cli-use-go-cross-compiler.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | From ae6f4a1e685394fb7b9539f134b66ca84ddc91c2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 3 | Date: Tue, 30 Jun 2020 22:19:56 -0400 | ||
| 4 | Subject: [PATCH] cli: use go cross compiler | ||
| 5 | |||
| 6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 7 | --- | ||
| 8 | git/cli/scripts/build/dynbinary | 2 +- | ||
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 10 | |||
| 11 | diff --git git/src/import/components/cli/scripts/build/dynbinary git/src/import/components/cli/scripts/build/dynbinary | ||
| 12 | index 4feb7e71d8..f990d0e040 100755 | ||
| 13 | --- git/src/import/components/cli/scripts/build/dynbinary | ||
| 14 | +++ git/src/import/components/cli/scripts/build/dynbinary | ||
| 15 | @@ -9,6 +9,6 @@ source ./scripts/build/.variables | ||
| 16 | |||
| 17 | echo "Building dynamically linked $TARGET" | ||
| 18 | export CGO_ENABLED=1 | ||
| 19 | -go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}" | ||
| 20 | +${GO} build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" -buildmode=pie "${SOURCE}" | ||
| 21 | |||
| 22 | ln -sf "$(basename "${TARGET}")" build/docker | ||
| 23 | -- | ||
| 24 | 2.19.1 | ||
| 25 | |||
diff --git a/recipes-containers/docker/docker-ce/0001-dynbinary-use-go-cross-compiler.patch b/recipes-containers/docker/docker-ce/0001-dynbinary-use-go-cross-compiler.patch new file mode 100644 index 00000000..c11c6e6a --- /dev/null +++ b/recipes-containers/docker/docker-ce/0001-dynbinary-use-go-cross-compiler.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | From bbf600cc4d46c3f7ec0c1b486790a2402d41f550 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 3 | Date: Tue, 30 Jun 2020 22:23:33 -0400 | ||
| 4 | Subject: [PATCH] dynbinary: use go cross compiler | ||
| 5 | |||
| 6 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 7 | --- | ||
| 8 | hack/make/.binary | 2 +- | ||
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 10 | |||
| 11 | diff --git a/src/import/components/engine/hack/make/.binary b/src/import/components/engine/hack/make/.binary | ||
| 12 | index 53de6749e5..47ab2a754f 100644 | ||
| 13 | --- a/src/import/components/engine/hack/make/.binary | ||
| 14 | +++ b/src/import/components/engine/hack/make/.binary | ||
| 15 | @@ -81,7 +81,7 @@ esac | ||
| 16 | |||
| 17 | echo "Building: $DEST/$BINARY_FULLNAME" | ||
| 18 | echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\"" | ||
| 19 | -go build \ | ||
| 20 | +${GO} build \ | ||
| 21 | -o "$DEST/$BINARY_FULLNAME" \ | ||
| 22 | "${BUILDFLAGS[@]}" \ | ||
| 23 | -ldflags " | ||
| 24 | -- | ||
| 25 | 2.19.1 | ||
| 26 | |||
diff --git a/recipes-containers/docker/docker-ce/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch b/recipes-containers/docker/docker-ce/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch new file mode 100644 index 00000000..70fdaf83 --- /dev/null +++ b/recipes-containers/docker/docker-ce/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From 1263fdb50a540e9db742694b7cee08284ad986d0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Wed, 17 Jul 2019 17:34:04 +0800 | ||
| 4 | Subject: [PATCH] imporve hardcoded CC on cross compile | ||
| 5 | |||
| 6 | Since commit applied in moby [61a3285 Support cross-compile for arm] | ||
| 7 | it hardcoded var-CC to support cross-compile for arm | ||
| 8 | |||
| 9 | Correct it with "${parameter:-word}" format, it is helpful for user | ||
| 10 | define toolchains | ||
| 11 | |||
| 12 | (Use Default Values. If parameter is unset or null, the expansion of | ||
| 13 | word is substituted. Otherwise, the value of parameter is substituted.) | ||
| 14 | |||
| 15 | Upstream-Status: Submitted [https://github.com/moby/moby/pull/39546] | ||
| 16 | |||
| 17 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 18 | --- | ||
| 19 | components/engine/hack/make/.binary | 10 +++++----- | ||
| 20 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/src/import/components/engine/hack/make/.binary b/src/import/components/engine/hack/make/.binary | ||
| 23 | index 53de6749e5..66f4ca05f3 100644 | ||
| 24 | --- a/src/import/components/engine/hack/make/.binary | ||
| 25 | +++ b/src/import/components/engine/hack/make/.binary | ||
| 26 | @@ -44,27 +44,27 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC | ||
| 27 | # must be cross-compiling! | ||
| 28 | case "$(go env GOOS)/$(go env GOARCH)" in | ||
| 29 | windows/amd64) | ||
| 30 | - export CC=x86_64-w64-mingw32-gcc | ||
| 31 | + export CC="${CC:-x86_64-w64-mingw32-gcc}" | ||
| 32 | export CGO_ENABLED=1 | ||
| 33 | ;; | ||
| 34 | linux/arm) | ||
| 35 | case "${GOARM}" in | ||
| 36 | 5|"") | ||
| 37 | - export CC=arm-linux-gnueabi-gcc | ||
| 38 | + export CC="${CC:-arm-linux-gnueabi-gcc}" | ||
| 39 | export CGO_ENABLED=1 | ||
| 40 | ;; | ||
| 41 | 7) | ||
| 42 | - export CC=arm-linux-gnueabihf-gcc | ||
| 43 | + export CC="${CC:-arm-linux-gnueabihf-gcc}" | ||
| 44 | export CGO_ENABLED=1 | ||
| 45 | ;; | ||
| 46 | esac | ||
| 47 | ;; | ||
| 48 | linux/arm64) | ||
| 49 | - export CC=aarch64-linux-gnu-gcc | ||
| 50 | + export CC="${CC:-aarch64-linux-gnu-gcc}" | ||
| 51 | export CGO_ENABLED=1 | ||
| 52 | ;; | ||
| 53 | linux/amd64) | ||
| 54 | - export CC=x86_64-linux-gnu-gcc | ||
| 55 | + export CC="${CC:-x86_64-linux-gnu-gcc}" | ||
| 56 | export CGO_ENABLED=1 | ||
| 57 | ;; | ||
| 58 | esac | ||
| 59 | -- | ||
| 60 | 2.23.0 | ||
| 61 | |||
diff --git a/recipes-containers/docker/docker-ce/0001-libnetwork-use-GO-instead-of-go.patch b/recipes-containers/docker/docker-ce/0001-libnetwork-use-GO-instead-of-go.patch new file mode 100644 index 00000000..c623b260 --- /dev/null +++ b/recipes-containers/docker/docker-ce/0001-libnetwork-use-GO-instead-of-go.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | From 04c07804930faad708218a3134c81de06a9c742a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 3 | Date: Fri, 6 Apr 2018 23:58:22 -0400 | ||
| 4 | Subject: [PATCH] libnetwork: use $(GO) instead of go | ||
| 5 | |||
| 6 | Ensure that the libnetwork makefile uses the go cross flags and | ||
| 7 | utilities. | ||
| 8 | |||
| 9 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 10 | --- | ||
| 11 | Makefile | 14 +++++++------- | ||
| 12 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
| 13 | |||
| 14 | Index: git/libnetwork/Makefile | ||
| 15 | =================================================================== | ||
| 16 | --- git.orig/libnetwork/Makefile | ||
| 17 | +++ git/libnetwork/Makefile | ||
| 18 | @@ -45,9 +45,9 @@ | ||
| 19 | build-local: | ||
| 20 | @echo "🐳 $@" | ||
| 21 | @mkdir -p "bin" | ||
| 22 | - go build -tags experimental -o "bin/dnet" ./cmd/dnet | ||
| 23 | - go build -o "bin/docker-proxy" ./cmd/proxy | ||
| 24 | - CGO_ENABLED=0 go build -o "bin/diagnosticClient" ./cmd/diagnostic | ||
| 25 | + $(GO) build -tags experimental -o "bin/dnet" ./cmd/dnet | ||
| 26 | + $(GO) build -o "bin/proxy" ./cmd/proxy | ||
| 27 | + CGO_ENABLED=0 $(GO) build -o "bin/diagnosticClient" ./cmd/diagnostic | ||
| 28 | CGO_ENABLED=0 go build -o "bin/testMain" ./cmd/networkdb-test/testMain.go | ||
| 29 | |||
| 30 | build-images: | ||
| 31 | @@ -82,8 +82,8 @@ | ||
| 32 | |||
| 33 | cross-local: | ||
| 34 | @echo "🐳 $@" | ||
| 35 | - go build -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet | ||
| 36 | - go build -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy | ||
| 37 | + @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/docker-proxy-$$GOOS-$$GOARCH" ./cmd/proxy | ||
| 38 | + @$(GO) build -linkshared $(GOBUILDFLAGS) -o "bin/dnet-$$GOOS-$$GOARCH" ./cmd/dnet | ||
| 39 | |||
| 40 | # Rebuild protocol buffers. | ||
| 41 | # These may need to be rebuilt after vendoring updates, so .proto files are declared .PHONY so they are always rebuilt. | ||
| 42 | @@ -130,7 +130,7 @@ | ||
| 43 | if ls $$dir/*.go &> /dev/null; then \ | ||
| 44 | pushd . &> /dev/null ; \ | ||
| 45 | cd $$dir ; \ | ||
| 46 | - go test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \ | ||
| 47 | + $(GO) test ${INSIDECONTAINER} -test.parallel 5 -test.v -covermode=count -coverprofile=./profile.tmp ; \ | ||
| 48 | ret=$$? ;\ | ||
| 49 | if [ $$ret -ne 0 ]; then exit $$ret; fi ;\ | ||
| 50 | popd &> /dev/null; \ | ||
| 51 | @@ -145,7 +145,7 @@ | ||
| 52 | # Depends on binaries because vet will silently fail if it can not load compiled imports | ||
| 53 | vet: ## run go vet | ||
| 54 | @echo "🐳 $@" | ||
| 55 | - @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)" | ||
| 56 | + @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)" | ||
| 57 | |||
| 58 | misspell: | ||
| 59 | @echo "🐳 $@" | ||
diff --git a/recipes-containers/docker/docker-ce/docker-registry.service b/recipes-containers/docker/docker-ce/docker-registry.service new file mode 100644 index 00000000..7b4bc468 --- /dev/null +++ b/recipes-containers/docker/docker-ce/docker-registry.service | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=docker private registry service | ||
| 3 | After=docker.service | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | ExecStartPre=-/usr/bin/docker kill registry | ||
| 7 | ExecStartPre=-/usr/bin/docker rm registry | ||
| 8 | ExecStart=/usr/bin/docker run --name registry -v /mirror/registry:/tmp/ -p 5000:5000 \ | ||
| 9 | -e "STANDALONE=true" \ | ||
| 10 | -e "MIRROR_SOURCE=https://registry-1.docker.io" \ | ||
| 11 | -e "MIRROR_SOURCE_INDEX=https://index.docker.io" \ | ||
| 12 | -e "SETTINGS_FLAVOR=local" \ | ||
| 13 | registry | ||
| 14 | ExecStop=-/usr/bin/docker stop registry | ||
| 15 | Restart=always | ||
| 16 | RestartSec=10s | ||
| 17 | |||
| 18 | [Install] | ||
| 19 | WantedBy=multi-user.target | ||
diff --git a/recipes-containers/docker/docker-ce/docker.init b/recipes-containers/docker/docker-ce/docker.init new file mode 100644 index 00000000..24f8fea6 --- /dev/null +++ b/recipes-containers/docker/docker-ce/docker.init | |||
| @@ -0,0 +1,131 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # /etc/rc.d/init.d/docker | ||
| 4 | # | ||
| 5 | # Daemon for docker.com | ||
| 6 | # | ||
| 7 | # chkconfig: 2345 95 95 | ||
| 8 | # description: Daemon for docker.com | ||
| 9 | |||
| 10 | ### BEGIN INIT INFO | ||
| 11 | # Provides: docker | ||
| 12 | # Required-Start: $network cgconfig | ||
| 13 | # Required-Stop: | ||
| 14 | # Should-Start: | ||
| 15 | # Should-Stop: | ||
| 16 | # Default-Start: 2 3 4 5 | ||
| 17 | # Default-Stop: 0 1 6 | ||
| 18 | # Short-Description: start and stop docker | ||
| 19 | # Description: Daemon for docker.com | ||
| 20 | ### END INIT INFO | ||
| 21 | |||
| 22 | # Source function library. | ||
| 23 | . /etc/init.d/functions | ||
| 24 | |||
| 25 | prog="dockerd" | ||
| 26 | unshare=/usr/bin/unshare | ||
| 27 | exec="/usr/bin/$prog" | ||
| 28 | pidfile="/var/run/$prog.pid" | ||
| 29 | lockfile="/var/lock/subsys/$prog" | ||
| 30 | logfile="/var/log/$prog" | ||
| 31 | other_args="--pidfile $pidfile --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs" | ||
| 32 | |||
| 33 | [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog | ||
| 34 | |||
| 35 | start() { | ||
| 36 | [ -x $exec ] || exit 5 | ||
| 37 | |||
| 38 | check_for_cleanup | ||
| 39 | |||
| 40 | if ! [ -f $pidfile ]; then | ||
| 41 | printf "Starting $prog:\t" | ||
| 42 | echo -e "\n$(date)\n" >> $logfile | ||
| 43 | "$unshare" -m -- $exec $other_args >> $logfile 2>&1 & | ||
| 44 | pid=$! | ||
| 45 | touch $lockfile | ||
| 46 | # wait up to 10 seconds for the pidfile to exist. see | ||
| 47 | # https://github.com/docker/docker/issues/5359 | ||
| 48 | tries=0 | ||
| 49 | while [ ! -f $pidfile -a $tries -lt 10 ]; do | ||
| 50 | sleep 1 | ||
| 51 | tries=$((tries + 1)) | ||
| 52 | done | ||
| 53 | success | ||
| 54 | echo | ||
| 55 | else | ||
| 56 | failure | ||
| 57 | echo | ||
| 58 | printf "$pidfile still exists...\n" | ||
| 59 | exit 7 | ||
| 60 | fi | ||
| 61 | } | ||
| 62 | |||
| 63 | stop() { | ||
| 64 | echo -n $"Stopping $prog: " | ||
| 65 | killproc $prog | ||
| 66 | retval=$? | ||
| 67 | echo | ||
| 68 | [ $retval -eq 0 ] && rm -f $lockfile | ||
| 69 | return $retval | ||
| 70 | } | ||
| 71 | |||
| 72 | restart() { | ||
| 73 | stop | ||
| 74 | start | ||
| 75 | } | ||
| 76 | |||
| 77 | reload() { | ||
| 78 | restart | ||
| 79 | } | ||
| 80 | |||
| 81 | force_reload() { | ||
| 82 | restart | ||
| 83 | } | ||
| 84 | |||
| 85 | rh_status() { | ||
| 86 | status $prog | ||
| 87 | } | ||
| 88 | |||
| 89 | rh_status_q() { | ||
| 90 | rh_status >/dev/null 2>&1 | ||
| 91 | } | ||
| 92 | |||
| 93 | |||
| 94 | check_for_cleanup() { | ||
| 95 | if [ -f ${pidfile} ]; then | ||
| 96 | /bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile} | ||
| 97 | fi | ||
| 98 | } | ||
| 99 | |||
| 100 | case "$1" in | ||
| 101 | start) | ||
| 102 | rh_status_q && exit 0 | ||
| 103 | $1 | ||
| 104 | ;; | ||
| 105 | stop) | ||
| 106 | rh_status_q || exit 0 | ||
| 107 | $1 | ||
| 108 | ;; | ||
| 109 | restart) | ||
| 110 | $1 | ||
| 111 | ;; | ||
| 112 | reload) | ||
| 113 | rh_status_q || exit 7 | ||
| 114 | $1 | ||
| 115 | ;; | ||
| 116 | force-reload) | ||
| 117 | force_reload | ||
| 118 | ;; | ||
| 119 | status) | ||
| 120 | rh_status | ||
| 121 | ;; | ||
| 122 | condrestart|try-restart) | ||
| 123 | rh_status_q || exit 0 | ||
| 124 | restart | ||
| 125 | ;; | ||
| 126 | *) | ||
| 127 | echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" | ||
| 128 | exit 2 | ||
| 129 | esac | ||
| 130 | |||
| 131 | exit $? | ||
