diff -ur ../src.orig/moby/daemon/daemon_linux.go ./moby/daemon/daemon_linux.go --- ../src.orig/moby/daemon/daemon_linux.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/daemon/daemon_linux.go 2023-10-15 10:01:18.840040920 +0000 @@ -24,7 +24,7 @@ // plugin socket files are created here and they cannot exceed max // path length of 108 bytes. func getPluginExecRoot(_ *config.Config) string { - return "/run/docker/plugins" + return "@TERMUX_PREFIX@/var/run/docker/plugins" } func (daemon *Daemon) cleanupMountsByID(id string) error { diff -ur ../src.orig/moby/pkg/plugins/discovery_unix.go ./moby/pkg/plugins/discovery_unix.go --- ../src.orig/moby/pkg/plugins/discovery_unix.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/pkg/plugins/discovery_unix.go 2023-10-15 10:03:23.583731494 +0000 @@ -15,7 +15,7 @@ return filepath.Join(configHome, "docker/plugins") } - return "/etc/docker/plugins" + return "@TERMUX_PREFIX@/etc/docker/plugins" } func rootlessLibPluginsPath() string { @@ -24,7 +24,7 @@ return filepath.Join(libHome, "docker/plugins") } - return "/usr/lib/docker/plugins" + return "@TERMUX_PREFIX@/lib/docker/plugins" } // SpecsPaths returns @@ -37,5 +37,5 @@ return []string{rootlessConfigPluginsPath(), rootlessLibPluginsPath()} } - return []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} + return []string{"@TERMUX_PREFIX@/etc/docker/plugins", "@TERMUX_PREFIX@/lib/docker/plugins"} } diff -ur ../src.orig/moby/registry/config_unix.go ./moby/registry/config_unix.go --- ../src.orig/moby/registry/config_unix.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/registry/config_unix.go 2023-10-15 10:03:57.087162563 +0000 @@ -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 = "@TERMUX_PREFIX@/etc/docker/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 -ur ../src.orig/moby/registry/endpoint_v1.go ./moby/registry/endpoint_v1.go --- ../src.orig/moby/registry/endpoint_v1.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/registry/endpoint_v1.go 2023-10-15 10:04:25.853913718 +0000 @@ -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 @TERMUX_PREFIX@/etc/docker/certs.d/%s/ca.crt", endpoint, err, endpoint.URL.Host, endpoint.URL.Host) } // If registry is insecure and HTTPS failed, fallback to HTTP. --- ./moby/daemon/config/config_linux.go.orig 2023-10-15 12:14:20.361907078 +0000 +++ ./moby/daemon/config/config_linux.go 2023-10-15 12:14:57.242040016 +0000 @@ -232,9 +232,9 @@ cfg.ExecRoot = filepath.Join(runtimeDir, "docker") cfg.Pidfile = filepath.Join(runtimeDir, "docker.pid") } else { - cfg.Root = "/var/lib/docker" - cfg.ExecRoot = "/var/run/docker" - cfg.Pidfile = "/var/run/docker.pid" + cfg.Root = "@TERMUX_PREFIX@/var/lib/docker" + cfg.ExecRoot = "@TERMUX_PREFIX@/var/run/docker" + cfg.Pidfile = "@TERMUX_PREFIX@/var/run/docker.pid" } return nil --- ../src.orig/libnetwork/cmd/dnet/dnet.go 2023-07-24 09:20:29.000000000 +0000 +++ ./libnetwork/cmd/dnet/dnet.go 2023-10-15 12:24:24.423989925 +0000 @@ -45,9 +45,9 @@ // DefaultHTTPPort is the default http port used by dnet DefaultHTTPPort = 2385 // DefaultUnixSocket exported - DefaultUnixSocket = "/var/run/dnet.sock" + DefaultUnixSocket = "@TERMUX_PREFIX@/var/run/dnet.sock" cfgFileEnv = "LIBNETWORK_CFG" - defaultCfgFile = "/etc/default/libnetwork.toml" + defaultCfgFile = "@TERMUX_PREFIX@/etc/default/libnetwork.toml" defaultHeartbeat = time.Duration(10) * time.Second ttlFactor = 2 ) @@ -408,11 +408,11 @@ fmt.Fprint(w, "null") }) - if err := os.MkdirAll("/etc/docker/plugins", 0755); err != nil { + if err := os.MkdirAll("@TERMUX_PREFIX@/etc/docker/plugins", 0755); err != nil { return err } - return ioutil.WriteFile("/etc/docker/plugins/test.spec", []byte(server.URL), 0644) + return ioutil.WriteFile("@TERMUX_PREFIX@/etc/docker/plugins/test.spec", []byte(server.URL), 0644) } func newDnetConnection(val string) (*dnetConnection, error) { --- ../src.orig/libnetwork/vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go 2023-07-24 09:20:29.000000000 +0000 +++ ./libnetwork/vendor/github.com/docker/docker/pkg/plugins/discovery_unix.go 2023-10-15 15:24:26.488911057 +0000 @@ -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{"@TERMUX_PREFIX@/etc/docker/plugins", "@TERMUX_PREFIX@/lib/docker/plugins"} --- ../src.orig/moby/vendor/github.com/containerd/containerd/defaults/defaults_unix.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/vendor/github.com/containerd/containerd/defaults/defaults_unix.go 2023-10-15 15:35:57.440889933 +0000 @@ -22,19 +22,19 @@ const ( // DefaultRootDir is the default location used by containerd to store // persistent data - DefaultRootDir = "/var/lib/containerd" + DefaultRootDir = "@TERMUX_PREFIX@/var/lib/containerd" // DefaultStateDir is the default location used by containerd to store // transient data - DefaultStateDir = "/run/containerd" + DefaultStateDir = "@TERMUX_PREFIX@/var/run/containerd" // DefaultAddress is the default unix socket address - DefaultAddress = "/run/containerd/containerd.sock" + DefaultAddress = "@TERMUX_PREFIX@/var/run/containerd/containerd.sock" // DefaultDebugAddress is the default unix socket address for pprof data - DefaultDebugAddress = "/run/containerd/debug.sock" + DefaultDebugAddress = "@TERMUX_PREFIX@/var/run/containerd/debug.sock" // DefaultFIFODir is the default location used by client-side cio library // to store FIFOs. - DefaultFIFODir = "/run/containerd/fifo" + DefaultFIFODir = "@TERMUX_PREFIX@/var/run/containerd/fifo" // DefaultRuntime is the default linux runtime DefaultRuntime = "io.containerd.runc.v2" // DefaultConfigDir is the default location for config files. - DefaultConfigDir = "/etc/containerd" + DefaultConfigDir = "@TERMUX_PREFIX@/etc/containerd" ) --- ../src.orig/moby/libnetwork/sandbox_dns_unix.go 2023-10-15 12:18:16.389408457 +0000 +++ ./moby/libnetwork/sandbox_dns_unix.go 2023-10-15 15:42:18.478461451 +0000 @@ -20,7 +20,7 @@ ) const ( - defaultPrefix = "/var/lib/docker/network/files" + defaultPrefix = "@TERMUX_PREFIX@/var/lib/docker/network/files" dirPerm = 0o755 filePerm = 0o644 ) --- ../src.orig/moby/libnetwork/datastore/datastore.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/libnetwork/datastore/datastore.go 2023-10-15 15:41:27.971678453 +0000 @@ -119,7 +119,7 @@ // SwarmScope is not indicating a datastore location. It is defined here // along with the other two scopes just for consistency. SwarmScope = "swarm" - defaultPrefix = "/var/lib/docker/network/files" + defaultPrefix = "@TERMUX_PREFIX@/var/lib/docker/network/files" ) const ( --- ../src.orig/moby/libnetwork/osl/namespace_linux.go 2023-08-29 19:14:17.000000000 +0000 +++ ./moby/libnetwork/osl/namespace_linux.go 2023-10-15 15:39:22.891386251 +0000 @@ -23,7 +23,7 @@ "golang.org/x/sys/unix" ) -const defaultPrefix = "/var/run/docker" +const defaultPrefix = "@TERMUX_PREFIX@/var/run/docker" func init() { // Lock main() to the initial thread to exclude the goroutines spawned --- ../src.orig/libnetwork/osl/namespace_linux.go 2023-07-24 09:20:29.000000000 +0000 +++ ./libnetwork/osl/namespace_linux.go 2023-10-15 15:50:42.480754012 +0000 @@ -23,7 +23,7 @@ "github.com/vishvananda/netns" ) -const defaultPrefix = "/var/run/docker" +const defaultPrefix = "@TERMUX_PREFIX@/var/run/docker" func init() { reexec.Register("set-ipv6", reexecSetIPv6)