Description: convert docker to loongker 
 loongker-ce (5:20.10.3-20) buster; urgency=low
   * Version: 20.10.3-20
   * convert docker to loongker 
Author: wanghuaiqing <wanghuaiqing@loongson.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2022-08-11

--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/cli/opts/hosts.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/cli/opts/hosts.go
@@ -12,18 +12,18 @@ const (
 	// defaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. dockerd -H tcp://
 	// These are the IANA registered port numbers for use with Docker
 	// see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker
-	defaultHTTPPort = "2375" // Default HTTP Port
+	defaultHTTPPort = "2377" // Default HTTP Port
 	// defaultTLSHTTPPort Default HTTP Port used when TLS enabled
-	defaultTLSHTTPPort = "2376" // Default TLS encrypted HTTP Port
+	defaultTLSHTTPPort = "2378" // Default TLS encrypted HTTP Port
 	// defaultUnixSocket Path for the unix socket.
 	// Docker daemon by default always listens on the default unix socket
-	defaultUnixSocket = "/var/run/docker.sock"
+	defaultUnixSocket = "/var/run/loongker.sock"
 	// defaultTCPHost constant defines the default host string used by docker on Windows
 	defaultTCPHost = "tcp://" + defaultHTTPHost + ":" + defaultHTTPPort
 	// DefaultTLSHost constant defines the default host string used by docker for TLS sockets
 	defaultTLSHost = "tcp://" + defaultHTTPHost + ":" + defaultTLSHTTPPort
 	// DefaultNamedPipe defines the default named pipe used by docker on Windows
-	defaultNamedPipe = `//./pipe/docker_engine`
+	defaultNamedPipe = `//./pipe/loongker_engine`
 	// hostGatewayName defines a special string which users can append to --add-host
 	// to add an extra entry in /etc/hosts that maps host.docker.internal to the host IP
 	// TODO Consider moving the hostGatewayName constant defined in docker at
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/cli/scripts/build/.variables
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/cli/scripts/build/.variables
@@ -26,7 +26,7 @@ if [ "${GOARCH}" = "arm" ]; then
 	GOARM="${GOARM:-$(go env GOHOSTARM)}"
 fi
 
-TARGET="build/docker-$GOOS-$GOARCH"
+TARGET="build/loongker-$GOOS-$GOARCH"
 if [ "${GOARCH}" = "arm" ] && [ -n "${GOARM}" ]; then
 	TARGET="${TARGET}-v${GOARM}"
 fi
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/cli/vendor/github.com/docker/docker/client/client_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/cli/vendor/github.com/docker/docker/client/client_unix.go
@@ -3,7 +3,7 @@
 package client // import "github.com/docker/docker/client"
 
 // DefaultDockerHost defines os specific default if DOCKER_HOST is unset
-const DefaultDockerHost = "unix:///var/run/docker.sock"
+const DefaultDockerHost = "unix:///var/run/loongker.sock"
 
 const defaultProto = "unix"
-const defaultAddr = "/var/run/docker.sock"
+const defaultAddr = "/var/run/loongker.sock"
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/builder/builder-next/executor_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/builder/builder-next/executor_unix.go
@@ -32,7 +32,7 @@ func newExecutor(root, cgroupParent stri
 	}
 	return runcexecutor.New(runcexecutor.Opt{
 		Root:                filepath.Join(root, "executor"),
-		CommandCandidates:   []string{"runc"},
+		CommandCandidates:   []string{"loong-runc"},
 		DefaultCgroupParent: cgroupParent,
 		Rootless:            rootless,
 		NoPivot:             os.Getenv("DOCKER_RAMDISK") != "",
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/client/client_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/client/client_unix.go
@@ -3,7 +3,7 @@
 package client // import "github.com/docker/docker/client"
 
 // DefaultDockerHost defines os specific default if DOCKER_HOST is unset
-const DefaultDockerHost = "unix:///var/run/docker.sock"
+const DefaultDockerHost = "unix:///var/run/loongker.sock"
 
 const defaultProto = "unix"
-const defaultAddr = "/var/run/docker.sock"
+const defaultAddr = "/var/run/loongker.sock"
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/cmd/dockerd/config_common_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/cmd/dockerd/config_common_unix.go
@@ -14,35 +14,35 @@ import (
 
 func getDefaultPidFile() (string, error) {
 	if !honorXDG {
-		return "/var/run/docker.pid", nil
+		return "/var/run/loongker.pid", nil
 	}
 	runtimeDir, err := homedir.GetRuntimeDir()
 	if err != nil {
 		return "", err
 	}
-	return filepath.Join(runtimeDir, "docker.pid"), nil
+	return filepath.Join(runtimeDir, "loongker.pid"), nil
 }
 
 func getDefaultDataRoot() (string, error) {
 	if !honorXDG {
-		return "/var/lib/docker", nil
+		return "/var/lib/loongker", nil
 	}
 	dataHome, err := homedir.GetDataHome()
 	if err != nil {
 		return "", err
 	}
-	return filepath.Join(dataHome, "docker"), nil
+	return filepath.Join(dataHome, "loongker"), nil
 }
 
 func getDefaultExecRoot() (string, error) {
 	if !honorXDG {
-		return "/var/run/docker", nil
+		return "/var/run/loongker", nil
 	}
 	runtimeDir, err := homedir.GetRuntimeDir()
 	if err != nil {
 		return "", err
 	}
-	return filepath.Join(runtimeDir, "docker"), nil
+	return filepath.Join(runtimeDir, "loongker"), nil
 }
 
 // installUnixConfigFlags adds command-line options to the top-level flag parser for
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/cmd/dockerd/daemon_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/cmd/dockerd/daemon_unix.go
@@ -25,7 +25,7 @@ import (
 
 func getDefaultDaemonConfigDir() (string, error) {
 	if !honorXDG {
-		return "/etc/docker", nil
+		return "/etc/loongker", nil
 	}
 	// NOTE: CLI uses ~/.docker while the daemon uses ~/.config/docker, because
 	// ~/.docker was not designed to store daemon configurations.
@@ -34,7 +34,7 @@ func getDefaultDaemonConfigDir() (string
 	if err != nil {
 		return "", nil
 	}
-	return filepath.Join(configHome, "docker"), nil
+	return filepath.Join(configHome, "loongker"), nil
 }
 
 func getDefaultDaemonConfigFile() (string, error) {
@@ -122,7 +122,7 @@ func allocateDaemonPort(addr string) err
 }
 
 func newCgroupParent(config *config.Config) string {
-	cgroupParent := "docker"
+	cgroupParent := "loongker"
 	useSystemd := daemon.UsingSystemd(config)
 	if useSystemd {
 		cgroupParent = "system.slice"
@@ -131,7 +131,7 @@ func newCgroupParent(config *config.Conf
 		cgroupParent = config.CgroupParent
 	}
 	if useSystemd {
-		cgroupParent = cgroupParent + ":" + "docker" + ":"
+		cgroupParent = cgroupParent + ":" + "loongker" + ":"
 	}
 	return cgroupParent
 }
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/config/config.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/config/config.go
@@ -43,11 +43,11 @@ const (
 	// DisableNetworkBridge is the default value of the option to disable network bridge
 	DisableNetworkBridge = "none"
 	// DefaultInitBinary is the name of the default init binary
-	DefaultInitBinary = "docker-init"
+	DefaultInitBinary = "loongker-init"
 
 	// StockRuntimeName is the reserved name/alias used to represent the
 	// OCI runtime being shipped with the docker daemon package.
-	StockRuntimeName = "runc"
+	StockRuntimeName = "loong-runc"
 	// LinuxV1RuntimeName is the runtime used to specify the containerd v1 shim with the runc binary
 	// Note this is different than io.containerd.runc.v1 which would be the v1 shim using the v2 shim API.
 	// This is specifically for the v1 shim using the v1 shim API.
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/daemon.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/daemon.go
@@ -75,7 +75,7 @@ import (
 
 // ContainersNamespace is the name of the namespace used for users containers
 const (
-	ContainersNamespace = "moby"
+	ContainersNamespace = "loongker"
 )
 
 var (
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/images/store.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/images/store.go
@@ -18,7 +18,7 @@ import (
 )
 
 func imageKey(dgst digest.Digest) string {
-	return "moby-image-" + dgst.String()
+	return "loongker-image-" + dgst.String()
 }
 
 // imageStoreWithLease wraps the configured image store with one that deletes the lease
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/listeners/group_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/listeners/group_unix.go
@@ -9,7 +9,7 @@ import (
 	"github.com/docker/docker/pkg/idtools"
 )
 
-const defaultSocketGroup = "docker"
+const defaultSocketGroup = "loongker"
 
 func lookupGID(name string) (int, error) {
 	group, err := idtools.LookupGroup(name)
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/logger/adapter.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/logger/adapter.go
@@ -64,7 +64,7 @@ func (a *pluginAdapter) Close() error {
 	a.mu.Lock()
 	defer a.mu.Unlock()
 
-	if err := a.plugin.StopLogging(filepath.Join("/", "run", "docker", "logging", a.id)); err != nil {
+	if err := a.plugin.StopLogging(filepath.Join("/", "run", "loongker", "logging", a.id)); err != nil {
 		return err
 	}
 
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/network.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/network.go
@@ -366,7 +366,7 @@ func (daemon *Daemon) createNetwork(crea
 	if err != nil {
 		if _, ok := err.(libnetwork.ErrDataStoreNotInitialized); ok {
 			// nolint: golint
-			return nil, errors.New("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.")
+			return nil, errors.New("This node is not a swarm manager. Use \"loongker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.")
 		}
 		return nil, err
 	}
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/daemon/oci_linux.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/daemon/oci_linux.go
@@ -790,8 +790,8 @@ func WithCommonOptions(daemon *Daemon, c
 func WithCgroups(daemon *Daemon, c *container.Container) coci.SpecOpts {
 	return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
 		var cgroupsPath string
-		scopePrefix := "docker"
-		parent := "/docker"
+		scopePrefix := "loongker"
+		parent := "/loongker"
 		useSystemd := UsingSystemd(daemon.configStore)
 		if useSystemd {
 			parent = "system.slice"
@@ -855,7 +855,7 @@ func WithCgroups(daemon *Daemon, c *cont
 		}
 		// When docker is run inside docker, the root is based of the host cgroup.
 		// Should this be handled in runc/libcontainer/cgroups ?
-		if strings.HasPrefix(root, "/docker/") {
+		if strings.HasPrefix(root, "/loongker/") {
 			root = "/"
 		}
 		mnt = filepath.Join(mnt, root)
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/opts/hosts.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/opts/hosts.go
@@ -15,18 +15,18 @@ const (
 	// DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. dockerd -H tcp://
 	// These are the IANA registered port numbers for use with Docker
 	// see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker
-	DefaultHTTPPort = 2375 // Default HTTP Port
+	DefaultHTTPPort = 2377 // Default HTTP Port
 	// DefaultTLSHTTPPort Default HTTP Port used when TLS enabled
-	DefaultTLSHTTPPort = 2376 // Default TLS encrypted HTTP Port
+	DefaultTLSHTTPPort = 2378 // Default TLS encrypted HTTP Port
 	// DefaultUnixSocket Path for the unix socket.
 	// Docker daemon by default always listens on the default unix socket
-	DefaultUnixSocket = "/var/run/docker.sock"
+	DefaultUnixSocket = "/var/run/loongker.sock"
 	// DefaultTCPHost constant defines the default host string used by docker on Windows
-	DefaultTCPHost = "tcp://" + DefaultHTTPHost + ":2375"
+	DefaultTCPHost = "tcp://" + DefaultHTTPHost + ":2377"
 	// DefaultTLSHost constant defines the default host string used by docker for TLS sockets
-	DefaultTLSHost = "tcp://" + DefaultHTTPHost + ":2376"
+	DefaultTLSHost = "tcp://" + DefaultHTTPHost + ":2378"
 	// DefaultNamedPipe defines the default named pipe used by docker on Windows
-	DefaultNamedPipe = `//./pipe/docker_engine`
+	DefaultNamedPipe = `//./pipe/loongker_engine`
 	// HostGatewayName is the string value that can be passed
 	// to the IPAddr section in --add-host that is replaced by
 	// the value of HostGatewayIP daemon config value
@@ -60,7 +60,7 @@ func ParseHost(defaultToTLS, defaultToUn
 			if err != nil {
 				return "", err
 			}
-			socket := filepath.Join(runtimeDir, "docker.sock")
+			socket := filepath.Join(runtimeDir, "loongker.sock")
 			host = "unix://" + socket
 		} else {
 			host = DefaultHost
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/vendor/github.com/docker/libnetwork/datastore/datastore.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/vendor/github.com/docker/libnetwork/datastore/datastore.go
@@ -119,7 +119,7 @@ const (
 	// 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 = "/var/lib/loongker/network/files"
 )
 
 const (
@@ -149,7 +149,7 @@ func makeDefaultScopes() map[string]*Sco
 	return def
 }
 
-var defaultRootChain = []string{"docker", "network", "v1.0"}
+var defaultRootChain = []string{"loongker", "network", "v1.0"}
 var rootChain = defaultRootChain
 
 // DefaultScopes returns a map of default scopes and its config for clients to use.
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/vendor/github.com/docker/libnetwork/sandbox_dns_unix.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/vendor/github.com/docker/libnetwork/sandbox_dns_unix.go
@@ -19,7 +19,7 @@ import (
 )
 
 const (
-	defaultPrefix = "/var/lib/docker/network/files"
+	defaultPrefix = "/var/lib/loongker/network/files"
 	dirPerm       = 0755
 	filePerm      = 0644
 )
--- lcf-utils-1.0.1/src/loongker-ce-20.10.3.orig/sources/engine/vendor/github.com/vishvananda/netns/netns_linux.go
+++ lcf-utils-1.0.1/src/loongker-ce-20.10.3/sources/engine/vendor/github.com/vishvananda/netns/netns_linux.go
@@ -159,13 +159,13 @@ func findCgroupMountpoint(cgroupType str
 // borrowed from docker/utils/utils.go
 // modified to get the docker pid instead of using /proc/self
 func getThisCgroup(cgroupType string) (string, error) {
-	dockerpid, err := ioutil.ReadFile("/var/run/docker.pid")
+	dockerpid, err := ioutil.ReadFile("/var/run/loongker.pid")
 	if err != nil {
 		return "", err
 	}
 	result := strings.Split(string(dockerpid), "\n")
 	if len(result) == 0 || len(result[0]) == 0 {
-		return "", fmt.Errorf("docker pid not found in /var/run/docker.pid")
+		return "", fmt.Errorf("loongker pid not found in /var/run/loongker.pid")
 	}
 	pid, err := strconv.Atoi(result[0])
 	if err != nil {
@@ -213,17 +213,17 @@ func getPidForContainer(id string) (int,
 		// With more recent lxc versions use, cgroup will be in lxc/
 		filepath.Join(cgroupRoot, cgroupThis, "lxc", id, "tasks"),
 		// With more recent docker, cgroup will be in docker/
-		filepath.Join(cgroupRoot, cgroupThis, "docker", id, "tasks"),
+		filepath.Join(cgroupRoot, cgroupThis, "loongker", id, "tasks"),
 		// Even more recent docker versions under systemd use docker-<id>.scope/
-		filepath.Join(cgroupRoot, "system.slice", "docker-"+id+".scope", "tasks"),
+		filepath.Join(cgroupRoot, "system.slice", "loongker-"+id+".scope", "tasks"),
 		// Even more recent docker versions under cgroup/systemd/docker/<id>/
-		filepath.Join(cgroupRoot, "..", "systemd", "docker", id, "tasks"),
+		filepath.Join(cgroupRoot, "..", "systemd", "loongker", id, "tasks"),
 		// Kubernetes with docker and CNI is even more different
 		filepath.Join(cgroupRoot, "..", "systemd", "kubepods", "*", "pod*", id, "tasks"),
 		// Another flavor of containers location in recent kubernetes 1.11+
-		filepath.Join(cgroupRoot, cgroupThis, "kubepods.slice", "kubepods-besteffort.slice", "*", "docker-"+id+".scope", "tasks"),
+		filepath.Join(cgroupRoot, cgroupThis, "kubepods.slice", "kubepods-besteffort.slice", "*", "loongker-"+id+".scope", "tasks"),
 		// When runs inside of a container with recent kubernetes 1.11+
-		filepath.Join(cgroupRoot, "kubepods.slice", "kubepods-besteffort.slice", "*", "docker-"+id+".scope", "tasks"),
+		filepath.Join(cgroupRoot, "kubepods.slice", "kubepods-besteffort.slice", "*", "loongker-"+id+".scope", "tasks"),
 	}
 
 	var filename string
