diff --git a/packages/addons/addon-depends/docker/cli/package.mk b/packages/addons/addon-depends/docker/cli/package.mk new file mode 100644 index 0000000000..65c134b0a0 --- /dev/null +++ b/packages/addons/addon-depends/docker/cli/package.mk @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="cli" +PKG_VERSION="$(get_pkg_version moby)" +PKG_SHA256="2f5949173515b70daa0b78fea7185ffd219ca31f7381a0e1218eeefc7f70199c" +PKG_LICENSE="ASL" +PKG_SITE="https://github.com/docker/cli" +PKG_URL="https://github.com/docker/cli/archive/v${PKG_VERSION}.tar.gz" +PKG_DEPENDS_TARGET="toolchain go:host" +PKG_LONGDESC="The Docker CLI" +PKG_TOOLCHAIN="manual" + +# Git commit of the matching release https://github.com/docker/cli/releases +export PKG_GIT_COMMIT="3e9117b7e241439e314eaf6fe944b4019fbaa941" + +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/cli + +go 1.18 +EOF + + GO111MODULE=auto ${GOLANG} mod tidy -modfile 'vendor.mod' -compat 1.18 + GO111MODULE=auto ${GOLANG} mod vendor -modfile vendor.mod +} + +make_target() { + mkdir -p bin + PKG_CLI_FLAGS="-X 'github.com/docker/cli/cli/version.Version=${VERSION}'" + PKG_CLI_FLAGS+=" -X 'github.com/docker/cli/cli/version.GitCommit=${GITCOMMIT}'" + PKG_CLI_FLAGS+=" -X 'github.com/docker/cli/cli/version.BuildTime=${BUILDTIME}'" + ${GOLANG} build -mod=mod -modfile=vendor.mod -v -o bin/docker -a -tags "${PKG_DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS} ${PKG_CLI_FLAGS}" ./cmd/docker +} + +makeinstall_target() { + : +} diff --git a/packages/addons/addon-depends/containerd/package.mk b/packages/addons/addon-depends/docker/containerd/package.mk similarity index 77% rename from packages/addons/addon-depends/containerd/package.mk rename to packages/addons/addon-depends/docker/containerd/package.mk index 96c27ec126..9d9c2c380c 100644 --- a/packages/addons/addon-depends/containerd/package.mk +++ b/packages/addons/addon-depends/docker/containerd/package.mk @@ -35,6 +35,7 @@ pre_make_target() { make_target() { mkdir -p bin - ${GOLANG} build -v -o bin/containerd -a -tags "static_build no_btrfs" -ldflags "${LDFLAGS}" ./cmd/containerd - ${GOLANG} build -v -o bin/containerd-shim -a -tags "static_build no_btrfs" -ldflags "${LDFLAGS}" ./cmd/containerd-shim + ${GOLANG} build -v -o bin/containerd -a -tags "static_build no_btrfs" -ldflags "${LDFLAGS}" ./cmd/containerd + ${GOLANG} build -v -o bin/containerd-shim -a -tags "static_build no_btrfs" -ldflags "${LDFLAGS}" ./cmd/containerd-shim + ${GOLANG} build -v -o bin/containerd-shim-runc-v2 -a -tags "static_build no_btrfs" -ldflags "${LDFLAGS}" ./cmd/containerd-shim-runc-v2 } diff --git a/packages/addons/addon-depends/libnetwork/package.mk b/packages/addons/addon-depends/docker/libnetwork/package.mk similarity index 100% rename from packages/addons/addon-depends/libnetwork/package.mk rename to packages/addons/addon-depends/docker/libnetwork/package.mk diff --git a/packages/addons/addon-depends/docker/moby/package.mk b/packages/addons/addon-depends/docker/moby/package.mk new file mode 100644 index 0000000000..388283eb23 --- /dev/null +++ b/packages/addons/addon-depends/docker/moby/package.mk @@ -0,0 +1,53 @@ +# 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/dockerd -a -tags "${PKG_MOBY_BUILDTAGS}" -ldflags "${LDFLAGS}" ./cmd/dockerd +} + +makeinstall_target() { + : +} diff --git a/packages/addons/addon-depends/docker/moby/patches/moby-001-user-addon-storage-location.patch b/packages/addons/addon-depends/docker/moby/patches/moby-001-user-addon-storage-location.patch new file mode 100644 index 0000000000..6354be2fb8 --- /dev/null +++ b/packages/addons/addon-depends/docker/moby/patches/moby-001-user-addon-storage-location.patch @@ -0,0 +1,284 @@ +# when updating this patch just create it from scratch using this command +# +# find . -name "*.go" -print | xargs sed -i 's/\/etc\/docker/\/storage\/.kodi\/userdata\/addon_data\/service.system.docker\/config/g' +# +# +diff -Naur a/cmd/dockerd/daemon_unix.go b/cmd/dockerd/daemon_unix.go +--- a/cmd/dockerd/daemon_unix.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/cmd/dockerd/daemon_unix.go 2022-06-07 14:28:05.510327911 -0700 +@@ -25,7 +25,7 @@ + + func getDefaultDaemonConfigDir() (string, error) { + if !honorXDG { +- return "/etc/docker", nil ++ return "/storage/.kodi/userdata/addon_data/service.system.docker/config", nil + } + // NOTE: CLI uses ~/.docker while the daemon uses ~/.config/docker, because + // ~/.docker was not designed to store daemon configurations. +diff -Naur a/integration/plugin/authz/authz_plugin_test.go b/integration/plugin/authz/authz_plugin_test.go +--- a/integration/plugin/authz/authz_plugin_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration/plugin/authz/authz_plugin_test.go 2022-06-07 14:28:05.570328822 -0700 +@@ -56,15 +56,15 @@ + ctrl = &authorizationController{} + teardown := setupTest(t) + +- err := os.MkdirAll("/etc/docker/plugins", 0755) ++ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) + assert.NilError(t, err) + +- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", testAuthZPlugin) ++ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", testAuthZPlugin) + err = os.WriteFile(fileName, []byte(server.URL), 0644) + assert.NilError(t, err) + + return func() { +- err := os.RemoveAll("/etc/docker/plugins") ++ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") + assert.NilError(t, err) + + teardown() +diff -Naur a/integration/plugin/graphdriver/external_test.go b/integration/plugin/graphdriver/external_test.go +--- a/integration/plugin/graphdriver/external_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration/plugin/graphdriver/external_test.go 2022-06-07 14:28:05.570328822 -0700 +@@ -80,7 +80,7 @@ + + sserver.Close() + jserver.Close() +- err := os.RemoveAll("/etc/docker/plugins") ++ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") + assert.NilError(t, err) + } + +@@ -345,10 +345,10 @@ + respond(w, &graphDriverResponse{Size: size}) + }) + +- err = os.MkdirAll("/etc/docker/plugins", 0755) ++ err = os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) + assert.NilError(t, err) + +- specFile := "/etc/docker/plugins/" + name + "." + ext ++ specFile := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/" + name + "." + ext + err = os.WriteFile(specFile, b, 0644) + assert.NilError(t, err) + } +diff -Naur a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go +--- a/integration-cli/docker_cli_daemon_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration-cli/docker_cli_daemon_test.go 2022-06-07 14:28:05.556328610 -0700 +@@ -558,12 +558,12 @@ + + func (s *DockerDaemonSuite) TestDaemonKeyGeneration(c *testing.T) { + // TODO: skip or update for Windows daemon +- os.Remove("/etc/docker/key.json") ++ os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") + c.Setenv("DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE", "1") + s.d.Start(c) + s.d.Stop(c) + +- k, err := libtrust.LoadKeyFile("/etc/docker/key.json") ++ k, err := libtrust.LoadKeyFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") + if err != nil { + c.Fatalf("Error opening key file") + } +@@ -1212,13 +1212,13 @@ + Y string `json:"y"` + } + +- os.Remove("/etc/docker/key.json") ++ os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") + c.Setenv("DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE", "1") + s.d.Start(c) + s.d.Stop(c) + + config := &Config{} +- bytes, err := os.ReadFile("/etc/docker/key.json") ++ bytes, err := os.ReadFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") + if err != nil { + c.Fatalf("Error reading key.json file: %s", err) + } +@@ -1238,11 +1238,11 @@ + } + + // write back +- if err := os.WriteFile("/etc/docker/key.json", newBytes, 0400); err != nil { ++ if err := os.WriteFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json", newBytes, 0400); err != nil { + c.Fatalf("Error os.WriteFile: %s", err) + } + +- defer os.Remove("/etc/docker/key.json") ++ defer os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") + + if err := s.d.StartWithError(); err == nil { + c.Fatalf("It should not be successful to start daemon with wrong key: %v", err) +diff -Naur a/integration-cli/docker_cli_external_volume_driver_test.go b/integration-cli/docker_cli_external_volume_driver_test.go +--- a/integration-cli/docker_cli_external_volume_driver_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration-cli/docker_cli_external_volume_driver_test.go 2022-06-07 14:28:05.556328610 -0700 +@@ -258,10 +258,10 @@ + send(w, `{"Capabilities": { "Scope": "global" }}`) + }) + +- err := os.MkdirAll("/etc/docker/plugins", 0755) ++ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) + assert.NilError(c, err) + +- err = os.WriteFile("/etc/docker/plugins/"+name+".spec", []byte(s.Server.URL), 0644) ++ err = os.WriteFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/"+name+".spec", []byte(s.Server.URL), 0644) + assert.NilError(c, err) + return s + } +@@ -269,7 +269,7 @@ + func (s *DockerExternalVolumeSuite) TearDownSuite(c *testing.T) { + s.volumePlugin.Close() + +- err := os.RemoveAll("/etc/docker/plugins") ++ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") + assert.NilError(c, err) + } + +@@ -359,7 +359,7 @@ + + // Make sure a request to use a down driver doesn't block other requests + func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *testing.T) { +- specPath := "/etc/docker/plugins/down-driver.spec" ++ specPath := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/down-driver.spec" + err := os.WriteFile(specPath, []byte("tcp://127.0.0.7:9999"), 0644) + assert.NilError(c, err) + defer os.RemoveAll(specPath) +diff -Naur a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go +--- a/integration-cli/docker_cli_network_unix_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration-cli/docker_cli_network_unix_test.go 2022-06-07 14:28:05.558328640 -0700 +@@ -196,14 +196,14 @@ + } + }) + +- err := os.MkdirAll("/etc/docker/plugins", 0755) ++ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) + assert.NilError(c, err) + +- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", netDrv) ++ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", netDrv) + err = os.WriteFile(fileName, []byte(url), 0644) + assert.NilError(c, err) + +- ipamFileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", ipamDrv) ++ ipamFileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", ipamDrv) + err = os.WriteFile(ipamFileName, []byte(url), 0644) + assert.NilError(c, err) + } +@@ -215,7 +215,7 @@ + + s.server.Close() + +- err := os.RemoveAll("/etc/docker/plugins") ++ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") + assert.NilError(c, err) + } + +diff -Naur a/integration-cli/docker_cli_swarm_test.go b/integration-cli/docker_cli_swarm_test.go +--- a/integration-cli/docker_cli_swarm_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/integration-cli/docker_cli_swarm_test.go 2022-06-07 14:28:05.561328685 -0700 +@@ -770,14 +770,14 @@ + } + }) + +- err := os.MkdirAll("/etc/docker/plugins", 0755) ++ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) + assert.NilError(c, err) + +- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", netDrv) ++ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", netDrv) + err = os.WriteFile(fileName, []byte(url), 0644) + assert.NilError(c, err) + +- ipamFileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", ipamDrv) ++ ipamFileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", ipamDrv) + err = os.WriteFile(ipamFileName, []byte(url), 0644) + assert.NilError(c, err) + } +@@ -789,7 +789,7 @@ + setupRemoteGlobalNetworkPlugin(c, mux, s.server.URL, globalNetworkPlugin, globalIPAMPlugin) + defer func() { + s.server.Close() +- err := os.RemoveAll("/etc/docker/plugins") ++ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") + assert.NilError(c, err) + }() + +diff -Naur a/libnetwork/drivers/remote/driver_test.go b/libnetwork/drivers/remote/driver_test.go +--- a/libnetwork/drivers/remote/driver_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/libnetwork/drivers/remote/driver_test.go 2022-06-07 14:28:05.586329065 -0700 +@@ -41,7 +41,7 @@ + } + + func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() { +- specPath := "/etc/docker/plugins" ++ specPath := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins" + if runtime.GOOS == "windows" { + specPath = filepath.Join(os.Getenv("programdata"), "docker", "plugins") + } +diff -Naur a/libnetwork/ipams/remote/remote_test.go b/libnetwork/ipams/remote/remote_test.go +--- a/libnetwork/ipams/remote/remote_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/libnetwork/ipams/remote/remote_test.go 2022-06-07 14:28:05.591329141 -0700 +@@ -36,7 +36,7 @@ + } + + func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() { +- specPath := "/etc/docker/plugins" ++ specPath := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins" + if runtime.GOOS == "windows" { + specPath = filepath.Join(os.Getenv("programdata"), "docker", "plugins") + } +diff -Naur a/libnetwork/libnetwork_unix_test.go b/libnetwork/libnetwork_unix_test.go +--- a/libnetwork/libnetwork_unix_test.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/libnetwork/libnetwork_unix_test.go 2022-06-07 14:28:05.592329156 -0700 +@@ -3,4 +3,4 @@ + + package libnetwork_test + +-var specPath = "/etc/docker/plugins" ++var specPath = "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins" +diff -Naur a/pkg/plugins/discovery_unix.go b/pkg/plugins/discovery_unix.go +--- a/pkg/plugins/discovery_unix.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/pkg/plugins/discovery_unix.go 2022-06-07 14:28:05.615329505 -0700 +@@ -3,4 +3,4 @@ + + package plugins // import "github.com/docker/docker/pkg/plugins" + +-var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} ++var specsPaths = []string{"/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", "/usr/lib/docker/plugins"} +diff -Naur a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go +--- a/pkg/plugins/plugins.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/pkg/plugins/plugins.go 2022-06-07 14:28:05.616329521 -0700 +@@ -4,7 +4,7 @@ + // Docker discovers plugins by looking for them in the plugin directory whenever + // a user or container tries to use one by name. UNIX domain socket files must + // be located under /run/docker/plugins, whereas spec files can be located +-// either under /etc/docker/plugins or /usr/lib/docker/plugins. This is handled ++// either under /storage/.kodi/userdata/addon_data/service.system.docker/config/plugins or /usr/lib/docker/plugins. This is handled + // by the Registry interface, which lets you list all plugins or get a plugin by + // its name if it exists. + // +diff -Naur a/registry/config_unix.go b/registry/config_unix.go +--- a/registry/config_unix.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/registry/config_unix.go 2022-06-07 14:28:05.626329672 -0700 +@@ -6,7 +6,7 @@ + // defaultCertsDir is the platform-specific default directory where certificates + // are stored. On Linux, it may be overridden through certsDir, for example, when + // running in rootless mode. +-const defaultCertsDir = "/etc/docker/certs.d" ++const defaultCertsDir = "/storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d" + + // cleanPath is used to ensure that a directory name is valid on the target + // platform. It will be passed in something *similar* to a URL such as +diff -Naur a/registry/endpoint_v1.go b/registry/endpoint_v1.go +--- a/registry/endpoint_v1.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/registry/endpoint_v1.go 2022-06-07 14:28:05.627329688 -0700 +@@ -63,7 +63,7 @@ + if endpoint.IsSecure { + // If registry is secure and HTTPS failed, show user the error and tell them about `--insecure-registry` + // in case that's what they need. DO NOT accept unknown CA certificates, and DO NOT fallback to HTTP. +- return invalidParamf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) ++ return invalidParamf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) + } + + // If registry is insecure and HTTPS failed, fallback to HTTP. diff --git a/packages/addons/addon-depends/docker/moby/patches/moby-002-use-unconfined-seccomp-profile-as-default.patch b/packages/addons/addon-depends/docker/moby/patches/moby-002-use-unconfined-seccomp-profile-as-default.patch new file mode 100644 index 0000000000..13bc313578 --- /dev/null +++ b/packages/addons/addon-depends/docker/moby/patches/moby-002-use-unconfined-seccomp-profile-as-default.patch @@ -0,0 +1,22 @@ +--- a/daemon/config/config.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/daemon/config/config.go 2022-06-07 14:29:36.755713207 -0700 +@@ -59,7 +59,7 @@ + LinuxV2RuntimeName = "io.containerd.runc.v2" + + // SeccompProfileDefault is the built-in default seccomp profile. +- SeccompProfileDefault = "builtin" ++ SeccompProfileDefault = "unconfined" + // SeccompProfileUnconfined is a special profile name for seccomp to use an + // "unconfined" seccomp profile. + SeccompProfileUnconfined = "unconfined" +--- a/daemon/daemon_unix.go 2022-06-03 10:30:24.000000000 -0700 ++++ b/daemon/daemon_unix.go 2022-06-07 14:34:55.315558083 -0700 +@@ -1711,8 +1711,6 @@ + + func (daemon *Daemon) setupSeccompProfile() error { + switch profile := daemon.configStore.SeccompProfile; profile { +- case "", config.SeccompProfileDefault: +- daemon.seccompProfilePath = config.SeccompProfileDefault + case config.SeccompProfileUnconfined: + daemon.seccompProfilePath = config.SeccompProfileUnconfined + default: diff --git a/packages/addons/addon-depends/runc/package.mk b/packages/addons/addon-depends/docker/runc/package.mk similarity index 100% rename from packages/addons/addon-depends/runc/package.mk rename to packages/addons/addon-depends/docker/runc/package.mk diff --git a/packages/addons/addon-depends/tini/package.mk b/packages/addons/addon-depends/docker/tini/package.mk similarity index 100% rename from packages/addons/addon-depends/tini/package.mk rename to packages/addons/addon-depends/docker/tini/package.mk diff --git a/packages/addons/service/docker/changelog.txt b/packages/addons/service/docker/changelog.txt index 5baf7179ae..bd662b3bb0 100644 --- a/packages/addons/service/docker/changelog.txt +++ b/packages/addons/service/docker/changelog.txt @@ -1,3 +1,7 @@ +136 +- moby: update to 22.06.0-beta.0 +- cli: update to 22.06.0-beta.0 + 135 - containerd: update to 1.6.5 - libnetwork: update to 2022-03-16 diff --git a/packages/addons/service/docker/package.mk b/packages/addons/service/docker/package.mk index d97ddde0f9..f689bb18ba 100644 --- a/packages/addons/service/docker/package.mk +++ b/packages/addons/service/docker/package.mk @@ -3,120 +3,33 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="docker" -PKG_VERSION="19.03.15" -PKG_SHA256="f2f31dd4137eaa735a26e590c9718fb06867afff4d8415cc80feb6cdc9e4a8cd" -PKG_REV="135" +PKG_REV="136" PKG_ARCH="any" PKG_LICENSE="ASL" PKG_SITE="http://www.docker.com/" -PKG_URL="https://github.com/docker/docker-ce/archive/v${PKG_VERSION}.tar.gz" -PKG_DEPENDS_TARGET="toolchain sqlite go:host containerd runc libnetwork tini systemd" +PKG_DEPENDS_TARGET="containerd runc libnetwork tini moby cli" PKG_SECTION="service/system" PKG_SHORTDESC="Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere." PKG_LONGDESC="Docker containers can encapsulate any payload, and will run consistently on and between virtually any server. The same container that a developer builds and tests on a laptop will run at scale, in production*, on VMs, bare-metal servers, OpenStack clusters, public instances, or combinations of the above." PKG_TOOLCHAIN="manual" -# Git commit of the matching release https://github.com/docker/docker-ce/releases -export PKG_GIT_COMMIT="99e3ed89195c4e551e87aad1e7453b65456b03ad" - PKG_IS_ADDON="yes" PKG_ADDON_NAME="Docker" PKG_ADDON_TYPE="xbmc.service" -PKG_DOCKER_BUILDTAGS="daemon \ - autogen \ - exclude_graphdriver_devicemapper \ - exclude_graphdriver_aufs \ - exclude_graphdriver_btrfs \ - journald" - -configure_target() { - go_configure - - PKG_GOPATH_ENGINE=${GOPATH} - PKG_GOPATH_CLI=${GOPATH}_cli - export GOPATH=${PKG_GOPATH_CLI}:${PKG_GOPATH_ENGINE} - export GO111MODULE=off - - export LDFLAGS="-w -linkmode external -extldflags -Wl,--unresolved-symbols=ignore-in-shared-libs -extld ${CC}" - - mkdir -p ${PKG_GOPATH_ENGINE} - mkdir -p ${PKG_GOPATH_CLI} - - PKG_ENGINE_PATH=${PKG_BUILD}/components/engine - PKG_CLI_PATH=${PKG_BUILD}/components/cli - - if [ -d ${PKG_ENGINE_PATH}/vendor ]; then - mv ${PKG_ENGINE_PATH}/vendor ${PKG_GOPATH_ENGINE}/src - fi - - if [ -d ${PKG_CLI_PATH}/vendor ]; then - mv ${PKG_CLI_PATH}/vendor ${PKG_GOPATH_CLI}/src - fi - - # Fix missing/incompatible .go files - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/frontend/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/frontend - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/frontend/gateway/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/frontend/gateway - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/solver/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/solver - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/moby/buildkit/util/progress/* ${PKG_GOPATH_CLI}/src/github.com/moby/buildkit/util/progress - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/docker/swarmkit/manager/* ${PKG_GOPATH_CLI}/src/github.com/docker/swarmkit/manager - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/coreos/etcd/raft/* ${PKG_GOPATH_CLI}/src/github.com/coreos/etcd/raft - cp -rf ${PKG_GOPATH_ENGINE}/src/golang.org/x/crypto/* ${PKG_GOPATH_CLI}/src/golang.org/x/crypto - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/opencontainers/runtime-spec/specs-go/* ${PKG_GOPATH_CLI}/src/github.com/opencontainers/runtime-spec/specs-go - - rm -rf ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd - mkdir -p ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/containerd/containerd/* ${PKG_GOPATH_CLI}/src/github.com/containerd/containerd - - rm -rf ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity - mkdir -p ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity - cp -rf ${PKG_GOPATH_ENGINE}/src/github.com/containerd/continuity/* ${PKG_GOPATH_CLI}/src/github.com/containerd/continuity - - mkdir -p ${PKG_GOPATH_CLI}/src/github.com/docker/docker/builder - cp -rf ${PKG_ENGINE_PATH}/builder/* ${PKG_GOPATH_CLI}/src/github.com/docker/docker/builder - - mkdir -p ${PKG_GOPATH_CLI}/src/github.com/docker/docker/pkg/idtools - cp -rf ${PKG_ENGINE_PATH}/pkg/idtools/* ${PKG_GOPATH_CLI}/src/github.com/docker/docker/pkg/idtools - - if [ ! -L ${PKG_GOPATH_ENGINE}/src/github.com/docker/docker ]; then - ln -fs ${PKG_ENGINE_PATH} ${PKG_GOPATH_ENGINE}/src/github.com/docker/docker - fi - - if [ ! -L ${PKG_GOPATH_CLI}/src/github.com/docker/cli ]; then - ln -fs ${PKG_CLI_PATH} ${PKG_GOPATH_CLI}/src/github.com/docker/cli - fi - - # used for docker version - export GITCOMMIT=${PKG_GIT_COMMIT} - export VERSION=${PKG_VERSION} - export BUILDTIME="$(date --utc)" - - cd ${PKG_ENGINE_PATH} - bash hack/make/.go-autogen - cd ${PKG_BUILD} -} - -make_target() { - mkdir -p bin - PKG_CLI_FLAGS="-X 'github.com/docker/cli/cli/version.Version=${VERSION}'" - PKG_CLI_FLAGS+=" -X 'github.com/docker/cli/cli/version.GitCommit=${GITCOMMIT}'" - PKG_CLI_FLAGS+=" -X 'github.com/docker/cli/cli/version.BuildTime=${BUILDTIME}'" - ${GOLANG} build -v -o bin/docker -a -tags "${PKG_DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS} ${PKG_CLI_FLAGS}" ./components/cli/cmd/docker - ${GOLANG} build -v -o bin/dockerd -a -tags "${PKG_DOCKER_BUILDTAGS}" -ldflags "${LDFLAGS}" ./components/engine/cmd/dockerd -} - -makeinstall_target() { - : -} - addon() { mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin - cp -P ${PKG_BUILD}/bin/docker ${ADDON_BUILD}/${PKG_ADDON_ID}/bin - cp -P ${PKG_BUILD}/bin/dockerd ${ADDON_BUILD}/${PKG_ADDON_ID}/bin + + # cli + cp -P $(get_build_dir cli)/bin/docker ${ADDON_BUILD}/${PKG_ADDON_ID}/bin + + # moby + cp -P $(get_build_dir moby)/bin/dockerd ${ADDON_BUILD}/${PKG_ADDON_ID}/bin # containerd cp -P $(get_build_dir containerd)/bin/containerd ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/containerd cp -P $(get_build_dir containerd)/bin/containerd-shim ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/containerd-shim + cp -P $(get_build_dir containerd)/bin/containerd-shim-runc-v2 ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/containerd-shim-runc-v2 # libnetwork cp -P $(get_build_dir libnetwork)/bin/docker-proxy ${ADDON_BUILD}/${PKG_ADDON_ID}/bin/docker-proxy diff --git a/packages/addons/service/docker/patches/docker-100.01-use-addon-storage-location.patch b/packages/addons/service/docker/patches/docker-100.01-use-addon-storage-location.patch deleted file mode 100644 index 65eee528bf..0000000000 --- a/packages/addons/service/docker/patches/docker-100.01-use-addon-storage-location.patch +++ /dev/null @@ -1,316 +0,0 @@ -From fd6bc40f8035924754d66b9aebef0ab83bc4d322 Mon Sep 17 00:00:00 2001 -From: 5schatten -Date: Tue, 8 Oct 2019 23:26:57 +0200 -Subject: [PATCH] Use Kodi addon storage path - ---- - .../github.com/docker/docker/registry/config_unix.go | 2 +- - .../github.com/docker/docker/registry/endpoint_v1.go | 2 +- - components/engine/cmd/dockerd/daemon_unix.go | 2 +- - components/engine/daemon/config/config_test.go | 2 +- - .../engine/integration-cli/docker_cli_daemon_test.go | 12 ++++++------ - .../docker_cli_external_volume_driver_test.go | 8 ++++---- - .../integration-cli/docker_cli_network_unix_test.go | 8 ++++---- - .../engine/integration-cli/docker_cli_swarm_test.go | 8 ++++---- - .../integration/plugin/authz/authz_plugin_test.go | 6 +++--- - .../integration/plugin/graphdriver/external_test.go | 6 +++--- - components/engine/pkg/plugins/discovery_unix.go | 2 +- - components/engine/pkg/plugins/plugins.go | 2 +- - components/engine/registry/config_unix.go | 2 +- - components/engine/registry/endpoint_v1.go | 2 +- - 14 files changed, 32 insertions(+), 32 deletions(-) - -diff --git a/components/cli/vendor/github.com/docker/docker/registry/config_unix.go b/components/cli/vendor/github.com/docker/docker/registry/config_unix.go -index 20fb47bcae..a023df7895 100644 ---- a/components/cli/vendor/github.com/docker/docker/registry/config_unix.go -+++ b/components/cli/vendor/github.com/docker/docker/registry/config_unix.go -@@ -4,7 +4,7 @@ package registry // import "github.com/docker/docker/registry" - - var ( - // CertsDir is the directory where certificates are stored -- CertsDir = "/etc/docker/certs.d" -+ CertsDir = "/storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d" - ) - - // cleanPath is used to ensure that a directory name is valid on the target -diff --git a/components/cli/vendor/github.com/docker/docker/registry/endpoint_v1.go b/components/cli/vendor/github.com/docker/docker/registry/endpoint_v1.go -index 2fc2ea0e74..5673cf1506 100644 ---- a/components/cli/vendor/github.com/docker/docker/registry/endpoint_v1.go -+++ b/components/cli/vendor/github.com/docker/docker/registry/endpoint_v1.go -@@ -49,7 +49,7 @@ func validateEndpoint(endpoint *V1Endpoint) error { - if endpoint.IsSecure { - // If registry is secure and HTTPS failed, show user the error and tell them about `--insecure-registry` - // in case that's what they need. DO NOT accept unknown CA certificates, and DO NOT fallback to HTTP. -- return fmt.Errorf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) -+ return fmt.Errorf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) - } - - // If registry is insecure and HTTPS failed, fallback to HTTP. -diff --git a/components/engine/cmd/dockerd/daemon_unix.go b/components/engine/cmd/dockerd/daemon_unix.go -index 2500260028..4e9f7ce46a 100644 ---- a/components/engine/cmd/dockerd/daemon_unix.go -+++ b/components/engine/cmd/dockerd/daemon_unix.go -@@ -25,7 +25,7 @@ import ( - - func getDefaultDaemonConfigDir() (string, error) { - if !honorXDG { -- return "/etc/docker", nil -+ return "/storage/.kodi/userdata/addon_data/service.system.docker/config", nil - } - // NOTE: CLI uses ~/.docker while the daemon uses ~/.config/docker, because - // ~/.docker was not designed to store daemon configurations. -diff --git a/components/engine/daemon/config/config_test.go b/components/engine/daemon/config/config_test.go -index b27548b200..7e546bac77 100644 ---- a/components/engine/daemon/config/config_test.go -+++ b/components/engine/daemon/config/config_test.go -@@ -517,7 +517,7 @@ func TestReloadSetConfigFileNotExist(t *testing.T) { - func TestReloadDefaultConfigNotExist(t *testing.T) { - skip.If(t, os.Getuid() != 0, "skipping test that requires root") - reloaded := false -- configFile := "/etc/docker/daemon.json" -+ configFile := "/storage/.kodi/userdata/addon_data/service.system.docker/config/daemon.json" - flags := pflag.NewFlagSet("test", pflag.ContinueOnError) - flags.String("config-file", configFile, "") - err := Reload(configFile, flags, func(c *Config) { -diff --git a/components/engine/integration-cli/docker_cli_daemon_test.go b/components/engine/integration-cli/docker_cli_daemon_test.go -index 6a874eb981..5b4846cf86 100644 ---- a/components/engine/integration-cli/docker_cli_daemon_test.go -+++ b/components/engine/integration-cli/docker_cli_daemon_test.go -@@ -553,11 +553,11 @@ func (s *DockerDaemonSuite) TestDaemonAllocatesListeningPort(c *testing.T) { - - func (s *DockerDaemonSuite) TestDaemonKeyGeneration(c *testing.T) { - // TODO: skip or update for Windows daemon -- os.Remove("/etc/docker/key.json") -+ os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") - s.d.Start(c) - s.d.Stop(c) - -- k, err := libtrust.LoadKeyFile("/etc/docker/key.json") -+ k, err := libtrust.LoadKeyFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") - if err != nil { - c.Fatalf("Error opening key file") - } -@@ -1188,12 +1188,12 @@ func (s *DockerDaemonSuite) TestDaemonWithWrongkey(c *testing.T) { - Y string `json:"y"` - } - -- os.Remove("/etc/docker/key.json") -+ os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") - s.d.Start(c) - s.d.Stop(c) - - config := &Config{} -- bytes, err := ioutil.ReadFile("/etc/docker/key.json") -+ bytes, err := ioutil.ReadFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") - if err != nil { - c.Fatalf("Error reading key.json file: %s", err) - } -@@ -1213,11 +1213,11 @@ func (s *DockerDaemonSuite) TestDaemonWithWrongkey(c *testing.T) { - } - - // write back -- if err := ioutil.WriteFile("/etc/docker/key.json", newBytes, 0400); err != nil { -+ if err := ioutil.WriteFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json", newBytes, 0400); err != nil { - c.Fatalf("Error ioutil.WriteFile: %s", err) - } - -- defer os.Remove("/etc/docker/key.json") -+ defer os.Remove("/storage/.kodi/userdata/addon_data/service.system.docker/config/key.json") - - if err := s.d.StartWithError(); err == nil { - c.Fatalf("It should not be successful to start daemon with wrong key: %v", err) -diff --git a/components/engine/integration-cli/docker_cli_external_volume_driver_test.go b/components/engine/integration-cli/docker_cli_external_volume_driver_test.go -index 94144f85c9..20afd4b37d 100644 ---- a/components/engine/integration-cli/docker_cli_external_volume_driver_test.go -+++ b/components/engine/integration-cli/docker_cli_external_volume_driver_test.go -@@ -258,10 +258,10 @@ func newVolumePlugin(c *testing.T, name string) *volumePlugin { - send(w, `{"Capabilities": { "Scope": "global" }}`) - }) - -- err := os.MkdirAll("/etc/docker/plugins", 0755) -+ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) - assert.NilError(c, err) - -- err = ioutil.WriteFile("/etc/docker/plugins/"+name+".spec", []byte(s.Server.URL), 0644) -+ err = ioutil.WriteFile("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/"+name+".spec", []byte(s.Server.URL), 0644) - assert.NilError(c, err) - return s - } -@@ -269,7 +269,7 @@ func newVolumePlugin(c *testing.T, name string) *volumePlugin { - func (s *DockerExternalVolumeSuite) TearDownSuite(c *testing.T) { - s.volumePlugin.Close() - -- err := os.RemoveAll("/etc/docker/plugins") -+ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") - assert.NilError(c, err) - } - -@@ -359,7 +359,7 @@ func hostVolumePath(name string) string { - - // Make sure a request to use a down driver doesn't block other requests - func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *testing.T) { -- specPath := "/etc/docker/plugins/down-driver.spec" -+ specPath := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/down-driver.spec" - err := ioutil.WriteFile(specPath, []byte("tcp://127.0.0.7:9999"), 0644) - assert.NilError(c, err) - defer os.RemoveAll(specPath) -diff --git a/components/engine/integration-cli/docker_cli_network_unix_test.go b/components/engine/integration-cli/docker_cli_network_unix_test.go -index 28cc9e9622..e7f21ddb5a 100644 ---- a/components/engine/integration-cli/docker_cli_network_unix_test.go -+++ b/components/engine/integration-cli/docker_cli_network_unix_test.go -@@ -196,14 +196,14 @@ func setupRemoteNetworkDrivers(c *testing.T, mux *http.ServeMux, url, netDrv, ip - } - }) - -- err := os.MkdirAll("/etc/docker/plugins", 0755) -+ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) - assert.NilError(c, err) - -- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", netDrv) -+ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", netDrv) - err = ioutil.WriteFile(fileName, []byte(url), 0644) - assert.NilError(c, err) - -- ipamFileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", ipamDrv) -+ ipamFileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", ipamDrv) - err = ioutil.WriteFile(ipamFileName, []byte(url), 0644) - assert.NilError(c, err) - } -@@ -215,7 +215,7 @@ func (s *DockerNetworkSuite) TearDownSuite(c *testing.T) { - - s.server.Close() - -- err := os.RemoveAll("/etc/docker/plugins") -+ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") - assert.NilError(c, err) - } - -diff --git a/components/engine/integration-cli/docker_cli_swarm_test.go b/components/engine/integration-cli/docker_cli_swarm_test.go -index 2493287140..feb73bd38a 100644 ---- a/components/engine/integration-cli/docker_cli_swarm_test.go -+++ b/components/engine/integration-cli/docker_cli_swarm_test.go -@@ -776,14 +776,14 @@ func setupRemoteGlobalNetworkPlugin(c *testing.T, mux *http.ServeMux, url, netDr - } - }) - -- err := os.MkdirAll("/etc/docker/plugins", 0755) -+ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) - assert.NilError(c, err) - -- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", netDrv) -+ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", netDrv) - err = ioutil.WriteFile(fileName, []byte(url), 0644) - assert.NilError(c, err) - -- ipamFileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", ipamDrv) -+ ipamFileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", ipamDrv) - err = ioutil.WriteFile(ipamFileName, []byte(url), 0644) - assert.NilError(c, err) - } -@@ -795,7 +795,7 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPlugin(c *testing.T) { - setupRemoteGlobalNetworkPlugin(c, mux, s.server.URL, globalNetworkPlugin, globalIPAMPlugin) - defer func() { - s.server.Close() -- err := os.RemoveAll("/etc/docker/plugins") -+ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") - assert.NilError(c, err) - }() - -diff --git a/components/engine/integration/plugin/authz/authz_plugin_test.go b/components/engine/integration/plugin/authz/authz_plugin_test.go -index 211bf9f6cc..6cd1cef909 100644 ---- a/components/engine/integration/plugin/authz/authz_plugin_test.go -+++ b/components/engine/integration/plugin/authz/authz_plugin_test.go -@@ -56,15 +56,15 @@ func setupTestV1(t *testing.T) func() { - ctrl = &authorizationController{} - teardown := setupTest(t) - -- err := os.MkdirAll("/etc/docker/plugins", 0755) -+ err := os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) - assert.NilError(t, err) - -- fileName := fmt.Sprintf("/etc/docker/plugins/%s.spec", testAuthZPlugin) -+ fileName := fmt.Sprintf("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/%s.spec", testAuthZPlugin) - err = ioutil.WriteFile(fileName, []byte(server.URL), 0644) - assert.NilError(t, err) - - return func() { -- err := os.RemoveAll("/etc/docker/plugins") -+ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") - assert.NilError(t, err) - - teardown() -diff --git a/components/engine/integration/plugin/graphdriver/external_test.go b/components/engine/integration/plugin/graphdriver/external_test.go -index 0013ec7bc7..45a6e20bf3 100644 ---- a/components/engine/integration/plugin/graphdriver/external_test.go -+++ b/components/engine/integration/plugin/graphdriver/external_test.go -@@ -79,7 +79,7 @@ func TestExternalGraphDriver(t *testing.T) { - - sserver.Close() - jserver.Close() -- err := os.RemoveAll("/etc/docker/plugins") -+ err := os.RemoveAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins") - assert.NilError(t, err) - } - -@@ -344,10 +344,10 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu - respond(w, &graphDriverResponse{Size: size}) - }) - -- err = os.MkdirAll("/etc/docker/plugins", 0755) -+ err = os.MkdirAll("/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", 0755) - assert.NilError(t, err) - -- specFile := "/etc/docker/plugins/" + name + "." + ext -+ specFile := "/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins/" + name + "." + ext - err = ioutil.WriteFile(specFile, b, 0644) - assert.NilError(t, err) - } -diff --git a/components/engine/pkg/plugins/discovery_unix.go b/components/engine/pkg/plugins/discovery_unix.go -index 58058f2828..a7b449ca25 100644 ---- a/components/engine/pkg/plugins/discovery_unix.go -+++ b/components/engine/pkg/plugins/discovery_unix.go -@@ -2,4 +2,4 @@ - - package plugins // import "github.com/docker/docker/pkg/plugins" - --var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} -+var specsPaths = []string{"/storage/.kodi/userdata/addon_data/service.system.docker/config/plugins", "/usr/lib/docker/plugins"} -diff --git a/components/engine/pkg/plugins/plugins.go b/components/engine/pkg/plugins/plugins.go -index 2371e92101..4c7a16a9a5 100644 ---- a/components/engine/pkg/plugins/plugins.go -+++ b/components/engine/pkg/plugins/plugins.go -@@ -4,7 +4,7 @@ - // Docker discovers plugins by looking for them in the plugin directory whenever - // a user or container tries to use one by name. UNIX domain socket files must - // be located under /run/docker/plugins, whereas spec files can be located --// either under /etc/docker/plugins or /usr/lib/docker/plugins. This is handled -+// either under /storage/.kodi/userdata/addon_data/service.system.docker/config/plugins or /usr/lib/docker/plugins. This is handled - // by the Registry interface, which lets you list all plugins or get a plugin by - // its name if it exists. - // -diff --git a/components/engine/registry/config_unix.go b/components/engine/registry/config_unix.go -index 20fb47bcae..a023df7895 100644 ---- a/components/engine/registry/config_unix.go -+++ b/components/engine/registry/config_unix.go -@@ -4,7 +4,7 @@ package registry // import "github.com/docker/docker/registry" - - var ( - // CertsDir is the directory where certificates are stored -- CertsDir = "/etc/docker/certs.d" -+ CertsDir = "/storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d" - ) - - // cleanPath is used to ensure that a directory name is valid on the target -diff --git a/components/engine/registry/endpoint_v1.go b/components/engine/registry/endpoint_v1.go -index 2fc2ea0e74..5673cf1506 100644 ---- a/components/engine/registry/endpoint_v1.go -+++ b/components/engine/registry/endpoint_v1.go -@@ -49,7 +49,7 @@ func validateEndpoint(endpoint *V1Endpoint) error { - if endpoint.IsSecure { - // If registry is secure and HTTPS failed, show user the error and tell them about `--insecure-registry` - // in case that's what they need. DO NOT accept unknown CA certificates, and DO NOT fallback to HTTP. -- return fmt.Errorf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) -+ return fmt.Errorf("invalid registry endpoint %s: %v. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry %s` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /storage/.kodi/userdata/addon_data/service.system.docker/config/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) - } - - // If registry is insecure and HTTPS failed, fallback to HTTP. diff --git a/packages/addons/service/docker/patches/docker-100.02-fix-containerd-pr3246.patch b/packages/addons/service/docker/patches/docker-100.02-fix-containerd-pr3246.patch deleted file mode 100644 index caa0353733..0000000000 --- a/packages/addons/service/docker/patches/docker-100.02-fix-containerd-pr3246.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/components/engine/vendor/github.com/containerd/containerd/runtime/v1/shim/client/client.go -+++ b/components/engine/vendor/github.com/containerd/containerd/runtime/v1/shim/client/client.go -@@ -219,7 +219,8 @@ - if err != nil { - return nil, nil, err - } -- client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onClose)) -+ client := ttrpc.NewClient(conn) -+ client.OnClose(onClose) - return shimapi.NewShimClient(client), conn, nil - } - } - diff --git a/packages/addons/service/docker/patches/docker-100.03-remove-marshaljson.patch b/packages/addons/service/docker/patches/docker-100.03-remove-marshaljson.patch deleted file mode 100644 index 6dc546e0ec..0000000000 --- a/packages/addons/service/docker/patches/docker-100.03-remove-marshaljson.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- a/components/engine/daemon/config/builder.go -+++ b/components/engine/daemon/config/builder.go -@@ -2,8 +2,6 @@ - - import ( - "encoding/json" -- "fmt" -- "sort" - "strings" - - "github.com/docker/docker/api/types/filters" -@@ -19,21 +17,6 @@ - // BuilderGCFilter contains garbage-collection filter rules for a BuildKit builder - type BuilderGCFilter filters.Args - --// MarshalJSON returns a JSON byte representation of the BuilderGCFilter --func (x *BuilderGCFilter) MarshalJSON() ([]byte, error) { -- f := filters.Args(*x) -- keys := f.Keys() -- sort.Strings(keys) -- arr := make([]string, 0, len(keys)) -- for _, k := range keys { -- values := f.Get(k) -- for _, v := range values { -- arr = append(arr, fmt.Sprintf("%s=%s", k, v)) -- } -- } -- return json.Marshal(arr) --} -- - // UnmarshalJSON fills the BuilderGCFilter values structure from JSON input - func (x *BuilderGCFilter) UnmarshalJSON(data []byte) error { - var arr []string