mirror of https://github.com/docker/cli.git
vendor: github.com/docker/docker 4b19b2f4babd (25.0-dev)
full diff: dab9ffb252...4b19b2f4ba
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f38870e68a
commit
3d0b14c3e3
|
@ -96,5 +96,5 @@ func (c *searchContext) IsOfficial() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *searchContext) IsAutomated() string {
|
func (c *searchContext) IsAutomated() string {
|
||||||
return c.formatBool(c.s.IsAutomated)
|
return c.formatBool(c.s.IsAutomated) //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,10 @@ func TestSearchContext(t *testing.T) {
|
||||||
s: registrytypes.SearchResult{IsOfficial: false},
|
s: registrytypes.SearchResult{IsOfficial: false},
|
||||||
}, "", ctx.IsOfficial},
|
}, "", ctx.IsOfficial},
|
||||||
{searchContext{
|
{searchContext{
|
||||||
s: registrytypes.SearchResult{IsAutomated: true},
|
s: registrytypes.SearchResult{IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
}, "[OK]", ctx.IsAutomated},
|
}, "[OK]", ctx.IsAutomated},
|
||||||
{searchContext{
|
{searchContext{
|
||||||
s: registrytypes.SearchResult{IsAutomated: false},
|
s: registrytypes.SearchResult{},
|
||||||
}, "", ctx.IsAutomated},
|
}, "", ctx.IsAutomated},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,8 +146,8 @@ result2 5
|
||||||
}
|
}
|
||||||
|
|
||||||
results := []registrytypes.SearchResult{
|
results := []registrytypes.SearchResult{
|
||||||
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true, IsAutomated: false},
|
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true},
|
||||||
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true},
|
{Name: "result2", Description: "Not official", StarCount: 5, IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
@ -168,8 +168,8 @@ result2 5
|
||||||
|
|
||||||
func TestSearchContextWriteJSON(t *testing.T) {
|
func TestSearchContextWriteJSON(t *testing.T) {
|
||||||
results := []registrytypes.SearchResult{
|
results := []registrytypes.SearchResult{
|
||||||
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true, IsAutomated: false},
|
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true},
|
||||||
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true},
|
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
}
|
}
|
||||||
expectedJSONs := []map[string]interface{}{
|
expectedJSONs := []map[string]interface{}{
|
||||||
{"Name": "result1", "Description": "Official build", "StarCount": "5000", "IsOfficial": "true", "IsAutomated": "false"},
|
{"Name": "result1", "Description": "Official build", "StarCount": "5000", "IsOfficial": "true", "IsAutomated": "false"},
|
||||||
|
@ -193,8 +193,8 @@ func TestSearchContextWriteJSON(t *testing.T) {
|
||||||
|
|
||||||
func TestSearchContextWriteJSONField(t *testing.T) {
|
func TestSearchContextWriteJSONField(t *testing.T) {
|
||||||
results := []registrytypes.SearchResult{
|
results := []registrytypes.SearchResult{
|
||||||
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true, IsAutomated: false},
|
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true},
|
||||||
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true},
|
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
}
|
}
|
||||||
out := bytes.NewBufferString("")
|
out := bytes.NewBufferString("")
|
||||||
err := SearchWrite(formatter.Context{Format: "{{json .Name}}", Output: out}, results)
|
err := SearchWrite(formatter.Context{Format: "{{json .Name}}", Output: out}, results)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["foo="],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":null,"ServerErrors":["a server error occurred"],"ClientInfo":{"Debug":false,"Context":"","Plugins":[],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["foo="],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":null,"ServerErrors":["a server error occurred"],"ClientInfo":{"Debug":false,"Context":"","Plugins":[],"Warnings":null}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":["WARNING: No memory limit support","WARNING: No swap limit support","WARNING: No oom kill disable support","WARNING: No cpu cfs quota support","WARNING: No cpu cfs period support","WARNING: No cpu shares support","WARNING: No cpuset support","WARNING: IPv4 forwarding is disabled","WARNING: bridge-nf-call-iptables is disabled","WARNING: bridge-nf-call-ip6tables is disabled"],"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":["WARNING: No memory limit support","WARNING: No swap limit support","WARNING: No oom kill disable support","WARNING: No cpu cfs quota support","WARNING: No cpu cfs period support","WARNING: No cpu shares support","WARNING: No cpuset support","WARNING: IPv4 forwarding is disabled","WARNING: bridge-nf-call-iptables is disabled","WARNING: bridge-nf-call-ip6tables is disabled"],"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":false,"SwapLimit":false,"CpuCfsPeriod":false,"CpuCfsQuota":false,"CPUShares":false,"CPUSet":false,"PidsLimit":false,"IPv4Forwarding":false,"BridgeNfIptables":false,"BridgeNfIp6tables":false,"Debug":true,"NFd":33,"OomKillDisable":false,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":null,"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":false,"SwapLimit":false,"CpuCfsPeriod":false,"CpuCfsQuota":false,"CPUShares":false,"CPUSet":false,"PidsLimit":false,"IPv4Forwarding":false,"BridgeNfIptables":false,"BridgeNfIp6tables":false,"Debug":true,"NFd":33,"OomKillDisable":false,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":null,"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":null,"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":null,"ClientInfo":{"Debug":true,"Platform":{"Name":"Docker Engine - Community"},"Version":"24.0.0","Context":"default","Plugins":[],"Warnings":null}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":null,"ClientInfo":{"Debug":false,"Context":"default","Plugins":[{"SchemaVersion":"0.1.0","Vendor":"ACME Corp","Version":"0.1.0","ShortDescription":"unit test is good","Name":"goodplugin","Path":"/path/to/docker-goodplugin"},{"SchemaVersion":"0.1.0","Vendor":"ACME Corp","ShortDescription":"this plugin has no version","Name":"unversionedplugin","Path":"/path/to/docker-unversionedplugin"},{"Name":"badplugin","Path":"/path/to/docker-badplugin","Err":"something wrong"}],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":null,"ClientInfo":{"Debug":false,"Context":"default","Plugins":[{"SchemaVersion":"0.1.0","Vendor":"ACME Corp","Version":"0.1.0","ShortDescription":"unit test is good","Name":"goodplugin","Path":"/path/to/docker-goodplugin"},{"SchemaVersion":"0.1.0","Vendor":"ACME Corp","ShortDescription":"this plugin has no version","Name":"unversionedplugin","Path":"/path/to/docker-unversionedplugin"},{"Name":"badplugin","Path":"/path/to/docker-badplugin","Err":"something wrong"}],"Warnings":null}}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"qo2dfdig9mmxqkawulggepdih","NodeAddr":"165.227.107.89","LocalNodeState":"active","ControlAvailable":true,"Error":"","RemoteManagers":[{"NodeID":"qo2dfdig9mmxqkawulggepdih","Addr":"165.227.107.89:2377"}],"Nodes":1,"Managers":1,"Cluster":{"ID":"9vs5ygs0gguyyec4iqf2314c0","Version":{"Index":11},"CreatedAt":"2017-08-24T17:34:19.278062352Z","UpdatedAt":"2017-08-24T17:34:42.398815481Z","Spec":{"Name":"default","Labels":null,"Orchestration":{"TaskHistoryRetentionLimit":5},"Raft":{"SnapshotInterval":10000,"KeepOldSnapshots":0,"LogEntriesForSlowFollowers":500,"ElectionTick":3,"HeartbeatTick":1},"Dispatcher":{"HeartbeatPeriod":5000000000},"CAConfig":{"NodeCertExpiry":7776000000000000},"TaskDefaults":{},"EncryptionConfig":{"AutoLockManagers":true}},"TLSInfo":{"TrustRoot":"\n-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUaFCW5xsq8eyiJ+Pmcv3MCflMLnMwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwODI0MTcyOTAwWhcNMzcwODE5MTcy\nOTAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABDy7NebyUJyUjWJDBUdnZoV6GBxEGKO4TZPNDwnxDxJcUdLVaB7WGa4/DLrW\nUfsVgh1JGik2VTiLuTMA1tLlNPOjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBQl16XFtaaXiUAwEuJptJlDjfKskDAKBggqhkjO\nPQQDAgNIADBFAiEAo9fTQNM5DP9bHVcTJYfl2Cay1bFu1E+lnpmN+EYJfeACIGKH\n1pCUkZ+D0IB6CiEZGWSHyLuXPM1rlP+I5KuS7sB8\n-----END CERTIFICATE-----\n","CertIssuerSubject":"MBMxETAPBgNVBAMTCHN3YXJtLWNh","CertIssuerPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPLs15vJQnJSNYkMFR2dmhXoYHEQYo7hNk80PCfEPElxR0tVoHtYZrj8MutZR+xWCHUkaKTZVOIu5MwDW0uU08w=="},"RootRotationInProgress":false,"DefaultAddrPool":null,"SubnetSize":0,"DataPathPort":0}},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"Warnings":null,"ClientInfo":{"Debug":false,"Context":"default","Plugins":[],"Warnings":null}}
|
{"ID":"EKHL:QDUU:QZ7U:MKGD:VDXK:S27Q:GIPU:24B7:R7VT:DGN6:QCSF:2UBX","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Using metacopy","false"],["Native Overlay Diff","true"]],"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":33,"OomKillDisable":true,"NGoroutines":135,"SystemTime":"2017-08-24T17:44:34.077811894Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.4.0-87-generic","OperatingSystem":"Ubuntu 16.04.3 LTS","OSVersion":"","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":null,"AllowNondistributableArtifactsHostnames":null,"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":null,"Secure":true,"Official":true}},"Mirrors":null},"NCPU":2,"MemTotal":2097356800,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"system-sample","Labels":["provider=digitalocean"],"ExperimentalBuild":false,"ServerVersion":"17.06.1-ce","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"qo2dfdig9mmxqkawulggepdih","NodeAddr":"165.227.107.89","LocalNodeState":"active","ControlAvailable":true,"Error":"","RemoteManagers":[{"NodeID":"qo2dfdig9mmxqkawulggepdih","Addr":"165.227.107.89:2377"}],"Nodes":1,"Managers":1,"Cluster":{"ID":"9vs5ygs0gguyyec4iqf2314c0","Version":{"Index":11},"CreatedAt":"2017-08-24T17:34:19.278062352Z","UpdatedAt":"2017-08-24T17:34:42.398815481Z","Spec":{"Name":"default","Labels":null,"Orchestration":{"TaskHistoryRetentionLimit":5},"Raft":{"SnapshotInterval":10000,"KeepOldSnapshots":0,"LogEntriesForSlowFollowers":500,"ElectionTick":3,"HeartbeatTick":1},"Dispatcher":{"HeartbeatPeriod":5000000000},"CAConfig":{"NodeCertExpiry":7776000000000000},"TaskDefaults":{},"EncryptionConfig":{"AutoLockManagers":true}},"TLSInfo":{"TrustRoot":"\n-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUaFCW5xsq8eyiJ+Pmcv3MCflMLnMwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwODI0MTcyOTAwWhcNMzcwODE5MTcy\nOTAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABDy7NebyUJyUjWJDBUdnZoV6GBxEGKO4TZPNDwnxDxJcUdLVaB7WGa4/DLrW\nUfsVgh1JGik2VTiLuTMA1tLlNPOjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBQl16XFtaaXiUAwEuJptJlDjfKskDAKBggqhkjO\nPQQDAgNIADBFAiEAo9fTQNM5DP9bHVcTJYfl2Cay1bFu1E+lnpmN+EYJfeACIGKH\n1pCUkZ+D0IB6CiEZGWSHyLuXPM1rlP+I5KuS7sB8\n-----END CERTIFICATE-----\n","CertIssuerSubject":"MBMxETAPBgNVBAMTCHN3YXJtLWNh","CertIssuerPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPLs15vJQnJSNYkMFR2dmhXoYHEQYo7hNk80PCfEPElxR0tVoHtYZrj8MutZR+xWCHUkaKTZVOIu5MwDW0uU08w=="},"RootRotationInProgress":false,"DefaultAddrPool":null,"SubnetSize":0,"DataPathPort":0}},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"6e23458c129b551d5c9871e5174f6b1b7f6d1170","Expected":"6e23458c129b551d5c9871e5174f6b1b7f6d1170"},"RuncCommit":{"ID":"810190ceaa507aa2727d7ae6f4790c76ec150bd2","Expected":"810190ceaa507aa2727d7ae6f4790c76ec150bd2"},"InitCommit":{"ID":"949e6fa","Expected":"949e6fa"},"SecurityOptions":["name=apparmor","name=seccomp,profile=default"],"DefaultAddressPools":[{"Base":"10.123.0.0/16","Size":24}],"CDISpecDirs":null,"Warnings":null,"ClientInfo":{"Debug":false,"Context":"default","Plugins":[],"Warnings":null}}
|
||||||
|
|
|
@ -12,7 +12,7 @@ require (
|
||||||
github.com/containerd/containerd v1.6.22
|
github.com/containerd/containerd v1.6.22
|
||||||
github.com/creack/pty v1.1.18
|
github.com/creack/pty v1.1.18
|
||||||
github.com/docker/distribution v2.8.2+incompatible
|
github.com/docker/distribution v2.8.2+incompatible
|
||||||
github.com/docker/docker v24.0.0-rc.2.0.20230714195812-dab9ffb25218+incompatible // master (v25.0.0-dev)
|
github.com/docker/docker v24.0.0-rc.2.0.20230807181406-4b19b2f4babd+incompatible // master (v25.0.0-dev)
|
||||||
github.com/docker/docker-credential-helpers v0.8.0
|
github.com/docker/docker-credential-helpers v0.8.0
|
||||||
github.com/docker/go-connections v0.4.0
|
github.com/docker/go-connections v0.4.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
|
|
@ -50,8 +50,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xb
|
||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||||
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v24.0.0-rc.2.0.20230714195812-dab9ffb25218+incompatible h1:lQ7FvH3oFGtG/ODOr0oAlRHQxJJkkbG+RyNHmiMWdI8=
|
github.com/docker/docker v24.0.0-rc.2.0.20230807181406-4b19b2f4babd+incompatible h1:jpw4copYljr4wqeQ6nSzvBNe83BqmStvHsvZdnlnEo0=
|
||||||
github.com/docker/docker v24.0.0-rc.2.0.20230714195812-dab9ffb25218+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v24.0.0-rc.2.0.20230807181406-4b19b2f4babd+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
|
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
|
||||||
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
|
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
|
|
|
@ -1147,6 +1147,7 @@ junxu <xujun@cmss.chinamobile.com>
|
||||||
Jussi Nummelin <jussi.nummelin@gmail.com>
|
Jussi Nummelin <jussi.nummelin@gmail.com>
|
||||||
Justas Brazauskas <brazauskasjustas@gmail.com>
|
Justas Brazauskas <brazauskasjustas@gmail.com>
|
||||||
Justen Martin <jmart@the-coder.com>
|
Justen Martin <jmart@the-coder.com>
|
||||||
|
Justin Chadwell <me@jedevc.com>
|
||||||
Justin Cormack <justin.cormack@docker.com>
|
Justin Cormack <justin.cormack@docker.com>
|
||||||
Justin Force <justin.force@gmail.com>
|
Justin Force <justin.force@gmail.com>
|
||||||
Justin Keller <85903732+jk-vb@users.noreply.github.com>
|
Justin Keller <85903732+jk-vb@users.noreply.github.com>
|
||||||
|
@ -1198,7 +1199,7 @@ Kenjiro Nakayama <nakayamakenjiro@gmail.com>
|
||||||
Kent Johnson <kentoj@gmail.com>
|
Kent Johnson <kentoj@gmail.com>
|
||||||
Kenta Tada <Kenta.Tada@sony.com>
|
Kenta Tada <Kenta.Tada@sony.com>
|
||||||
Kevin "qwazerty" Houdebert <kevin.houdebert@gmail.com>
|
Kevin "qwazerty" Houdebert <kevin.houdebert@gmail.com>
|
||||||
Kevin Alvarez <crazy-max@users.noreply.github.com>
|
Kevin Alvarez <github@crazymax.dev>
|
||||||
Kevin Burke <kev@inburke.com>
|
Kevin Burke <kev@inburke.com>
|
||||||
Kevin Clark <kevin.clark@gmail.com>
|
Kevin Clark <kevin.clark@gmail.com>
|
||||||
Kevin Feyrer <kevin.feyrer@btinternet.com>
|
Kevin Feyrer <kevin.feyrer@btinternet.com>
|
||||||
|
@ -1519,7 +1520,7 @@ Mike Snitzer <snitzer@redhat.com>
|
||||||
mikelinjie <294893458@qq.com>
|
mikelinjie <294893458@qq.com>
|
||||||
Mikhail Sobolev <mss@mawhrin.net>
|
Mikhail Sobolev <mss@mawhrin.net>
|
||||||
Miklos Szegedi <miklos.szegedi@cloudera.com>
|
Miklos Szegedi <miklos.szegedi@cloudera.com>
|
||||||
Milas Bowman <milasb@gmail.com>
|
Milas Bowman <devnull@milas.dev>
|
||||||
Milind Chawre <milindchawre@gmail.com>
|
Milind Chawre <milindchawre@gmail.com>
|
||||||
Miloslav Trmač <mitr@redhat.com>
|
Miloslav Trmač <mitr@redhat.com>
|
||||||
mingqing <limingqing@cyou-inc.com>
|
mingqing <limingqing@cyou-inc.com>
|
||||||
|
@ -1712,6 +1713,7 @@ Phil Estes <estesp@gmail.com>
|
||||||
Phil Sphicas <phil.sphicas@att.com>
|
Phil Sphicas <phil.sphicas@att.com>
|
||||||
Phil Spitler <pspitler@gmail.com>
|
Phil Spitler <pspitler@gmail.com>
|
||||||
Philip Alexander Etling <paetling@gmail.com>
|
Philip Alexander Etling <paetling@gmail.com>
|
||||||
|
Philip K. Warren <pkwarren@gmail.com>
|
||||||
Philip Monroe <phil@philmonroe.com>
|
Philip Monroe <phil@philmonroe.com>
|
||||||
Philipp Gillé <philipp.gille@gmail.com>
|
Philipp Gillé <philipp.gille@gmail.com>
|
||||||
Philipp Wahala <philipp.wahala@gmail.com>
|
Philipp Wahala <philipp.wahala@gmail.com>
|
||||||
|
|
|
@ -5301,7 +5301,25 @@ definitions:
|
||||||
- "WARNING: No memory limit support"
|
- "WARNING: No memory limit support"
|
||||||
- "WARNING: bridge-nf-call-iptables is disabled"
|
- "WARNING: bridge-nf-call-iptables is disabled"
|
||||||
- "WARNING: bridge-nf-call-ip6tables is disabled"
|
- "WARNING: bridge-nf-call-ip6tables is disabled"
|
||||||
|
CDISpecDirs:
|
||||||
|
description: |
|
||||||
|
List of directories where (Container Device Interface) CDI
|
||||||
|
specifications are located.
|
||||||
|
|
||||||
|
These specifications define vendor-specific modifications to an OCI
|
||||||
|
runtime specification for a container being created.
|
||||||
|
|
||||||
|
An empty list indicates that CDI device injection is disabled.
|
||||||
|
|
||||||
|
Note that since using CDI device injection requires the daemon to have
|
||||||
|
experimental enabled. For non-experimental daemons an empty list will
|
||||||
|
always be returned.
|
||||||
|
type: "array"
|
||||||
|
items:
|
||||||
|
type: "string"
|
||||||
|
example:
|
||||||
|
- "/etc/cdi"
|
||||||
|
- "/var/run/cdi"
|
||||||
|
|
||||||
# PluginsInfo is a temp struct holding Plugins name
|
# PluginsInfo is a temp struct holding Plugins name
|
||||||
# registered with docker daemon. It is used by Info struct
|
# registered with docker daemon. It is used by Info struct
|
||||||
|
@ -8601,28 +8619,36 @@ paths:
|
||||||
is_official:
|
is_official:
|
||||||
type: "boolean"
|
type: "boolean"
|
||||||
is_automated:
|
is_automated:
|
||||||
|
description: |
|
||||||
|
Whether this repository has automated builds enabled.
|
||||||
|
|
||||||
|
<p><br /></p>
|
||||||
|
|
||||||
|
> **Deprecated**: This field is deprecated and will always
|
||||||
|
> be "false" in future.
|
||||||
type: "boolean"
|
type: "boolean"
|
||||||
|
example: false
|
||||||
name:
|
name:
|
||||||
type: "string"
|
type: "string"
|
||||||
star_count:
|
star_count:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
examples:
|
examples:
|
||||||
application/json:
|
application/json:
|
||||||
- description: ""
|
- description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!"
|
||||||
is_official: false
|
is_official: true
|
||||||
is_automated: false
|
is_automated: false
|
||||||
name: "wma55/u1210sshd"
|
name: "alpine"
|
||||||
star_count: 0
|
star_count: 10093
|
||||||
- description: ""
|
- description: "Busybox base image."
|
||||||
is_official: false
|
is_official: true
|
||||||
is_automated: false
|
is_automated: false
|
||||||
name: "jdswinbank/sshd"
|
name: "Busybox base image."
|
||||||
star_count: 0
|
star_count: 3037
|
||||||
- description: ""
|
- description: "The PostgreSQL object-relational database system provides reliability and data integrity."
|
||||||
is_official: false
|
is_official: true
|
||||||
is_automated: false
|
is_automated: false
|
||||||
name: "vgauthier/sshd"
|
name: "postgres"
|
||||||
star_count: 0
|
star_count: 12408
|
||||||
500:
|
500:
|
||||||
description: "Server error"
|
description: "Server error"
|
||||||
schema:
|
schema:
|
||||||
|
@ -8642,9 +8668,13 @@ paths:
|
||||||
description: |
|
description: |
|
||||||
A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
|
A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
|
||||||
|
|
||||||
- `is-automated=(true|false)`
|
- `is-automated=(true|false)` (deprecated, see below)
|
||||||
- `is-official=(true|false)`
|
- `is-official=(true|false)`
|
||||||
- `stars=<number>` Matches images that has at least 'number' stars.
|
- `stars=<number>` Matches images that has at least 'number' stars.
|
||||||
|
|
||||||
|
The `is-automated` filter is deprecated. The `is_automated` field has
|
||||||
|
been deprecated by Docker Hub's search API. Consequently, searching
|
||||||
|
for `is-automated=true` will yield no results.
|
||||||
type: "string"
|
type: "string"
|
||||||
tags: ["Image"]
|
tags: ["Image"]
|
||||||
/images/prune:
|
/images/prune:
|
||||||
|
|
|
@ -98,7 +98,7 @@ func FromJSON(p string) (Args, error) {
|
||||||
// Fallback to parsing arguments in the legacy slice format
|
// Fallback to parsing arguments in the legacy slice format
|
||||||
deprecated := map[string][]string{}
|
deprecated := map[string][]string{}
|
||||||
if legacyErr := json.Unmarshal(raw, &deprecated); legacyErr != nil {
|
if legacyErr := json.Unmarshal(raw, &deprecated); legacyErr != nil {
|
||||||
return args, invalidFilter{}
|
return args, &invalidFilter{}
|
||||||
}
|
}
|
||||||
|
|
||||||
args.fields = deprecatedArgs(deprecated)
|
args.fields = deprecatedArgs(deprecated)
|
||||||
|
@ -206,7 +206,7 @@ func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(fieldValues) == 0 {
|
if len(fieldValues) == 0 {
|
||||||
return defaultValue, invalidFilter{key, nil}
|
return defaultValue, &invalidFilter{key, nil}
|
||||||
}
|
}
|
||||||
|
|
||||||
isFalse := fieldValues["0"] || fieldValues["false"]
|
isFalse := fieldValues["0"] || fieldValues["false"]
|
||||||
|
@ -216,7 +216,7 @@ func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) {
|
||||||
invalid := !isFalse && !isTrue
|
invalid := !isFalse && !isTrue
|
||||||
|
|
||||||
if conflicting || invalid {
|
if conflicting || invalid {
|
||||||
return defaultValue, invalidFilter{key, args.Get(key)}
|
return defaultValue, &invalidFilter{key, args.Get(key)}
|
||||||
} else if isFalse {
|
} else if isFalse {
|
||||||
return false, nil
|
return false, nil
|
||||||
} else if isTrue {
|
} else if isTrue {
|
||||||
|
@ -224,7 +224,7 @@ func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code shouldn't be reached.
|
// This code shouldn't be reached.
|
||||||
return defaultValue, unreachableCode{Filter: key, Value: args.Get(key)}
|
return defaultValue, &unreachableCode{Filter: key, Value: args.Get(key)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExactMatch returns true if the source matches exactly one of the values.
|
// ExactMatch returns true if the source matches exactly one of the values.
|
||||||
|
@ -282,7 +282,7 @@ func (args Args) Contains(field string) bool {
|
||||||
func (args Args) Validate(accepted map[string]bool) error {
|
func (args Args) Validate(accepted map[string]bool) error {
|
||||||
for name := range args.fields {
|
for name := range args.fields {
|
||||||
if !accepted[name] {
|
if !accepted[name] {
|
||||||
return invalidFilter{name, nil}
|
return &invalidFilter{name, nil}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -92,7 +92,9 @@ type SearchResult struct {
|
||||||
IsOfficial bool `json:"is_official"`
|
IsOfficial bool `json:"is_official"`
|
||||||
// Name is the name of the repository
|
// Name is the name of the repository
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
// IsAutomated indicates whether the result is automated
|
// IsAutomated indicates whether the result is automated.
|
||||||
|
//
|
||||||
|
// Deprecated: the "is_automated" field is deprecated and will always be "false" in the future.
|
||||||
IsAutomated bool `json:"is_automated"`
|
IsAutomated bool `json:"is_automated"`
|
||||||
// Description is a textual description of the repository
|
// Description is a textual description of the repository
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|
|
@ -73,6 +73,7 @@ type Info struct {
|
||||||
SecurityOptions []string
|
SecurityOptions []string
|
||||||
ProductLicense string `json:",omitempty"`
|
ProductLicense string `json:",omitempty"`
|
||||||
DefaultAddressPools []NetworkAddressPool `json:",omitempty"`
|
DefaultAddressPools []NetworkAddressPool `json:",omitempty"`
|
||||||
|
CDISpecDirs []string
|
||||||
|
|
||||||
// Legacy API fields for older API versions.
|
// Legacy API fields for older API versions.
|
||||||
legacyFields
|
legacyFields
|
||||||
|
|
|
@ -43,11 +43,13 @@ package client // import "github.com/docker/docker/client"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/docker/docker/api"
|
"github.com/docker/docker/api"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
@ -86,9 +88,6 @@ import (
|
||||||
// [Go stdlib]: https://github.com/golang/go/blob/6244b1946bc2101b01955468f1be502dbadd6807/src/net/http/transport.go#L558-L569
|
// [Go stdlib]: https://github.com/golang/go/blob/6244b1946bc2101b01955468f1be502dbadd6807/src/net/http/transport.go#L558-L569
|
||||||
const DummyHost = "api.moby.localhost"
|
const DummyHost = "api.moby.localhost"
|
||||||
|
|
||||||
// ErrRedirect is the error returned by checkRedirect when the request is non-GET.
|
|
||||||
var ErrRedirect = errors.New("unexpected redirect in response")
|
|
||||||
|
|
||||||
// Client is the API client that performs all operations
|
// Client is the API client that performs all operations
|
||||||
// against a docker server.
|
// against a docker server.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
@ -111,7 +110,7 @@ type Client struct {
|
||||||
// header variables. When set to an empty string, the User-Agent header
|
// header variables. When set to an empty string, the User-Agent header
|
||||||
// is removed, and no header is sent.
|
// is removed, and no header is sent.
|
||||||
userAgent *string
|
userAgent *string
|
||||||
// custom http headers configured by users.
|
// custom HTTP headers configured by users.
|
||||||
customHTTPHeaders map[string]string
|
customHTTPHeaders map[string]string
|
||||||
// manualOverride is set to true when the version was set by users.
|
// manualOverride is set to true when the version was set by users.
|
||||||
manualOverride bool
|
manualOverride bool
|
||||||
|
@ -126,20 +125,25 @@ type Client struct {
|
||||||
negotiated bool
|
negotiated bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckRedirect specifies the policy for dealing with redirect responses:
|
// ErrRedirect is the error returned by checkRedirect when the request is non-GET.
|
||||||
// If the request is non-GET return ErrRedirect, otherwise use the last response.
|
var ErrRedirect = errors.New("unexpected redirect in response")
|
||||||
|
|
||||||
|
// CheckRedirect specifies the policy for dealing with redirect responses. It
|
||||||
|
// can be set on [http.Client.CheckRedirect] to prevent HTTP redirects for
|
||||||
|
// non-GET requests. It returns an [ErrRedirect] for non-GET request, otherwise
|
||||||
|
// returns a [http.ErrUseLastResponse], which is special-cased by http.Client
|
||||||
|
// to use the last response.
|
||||||
//
|
//
|
||||||
// Go 1.8 changes behavior for HTTP redirects (specifically 301, 307, and 308)
|
// Go 1.8 changed behavior for HTTP redirects (specifically 301, 307, and 308)
|
||||||
// in the client. The Docker client (and by extension docker API client) can be
|
// in the client. The client (and by extension API client) can be made to send
|
||||||
// made to send a request like POST /containers//start where what would normally
|
// a request like "POST /containers//start" where what would normally be in the
|
||||||
// be in the name section of the URL is empty. This triggers an HTTP 301 from
|
// name section of the URL is empty. This triggers an HTTP 301 from the daemon.
|
||||||
// the daemon.
|
|
||||||
//
|
//
|
||||||
// In go 1.8 this 301 will be converted to a GET request, and ends up getting
|
// In go 1.8 this 301 is converted to a GET request, and ends up getting
|
||||||
// a 404 from the daemon. This behavior change manifests in the client in that
|
// a 404 from the daemon. This behavior change manifests in the client in that
|
||||||
// before, the 301 was not followed and the client did not generate an error,
|
// before, the 301 was not followed and the client did not generate an error,
|
||||||
// but now results in a message like Error response from daemon: page not found.
|
// but now results in a message like "Error response from daemon: page not found".
|
||||||
func CheckRedirect(req *http.Request, via []*http.Request) error {
|
func CheckRedirect(_ *http.Request, via []*http.Request) error {
|
||||||
if via[0].Method == http.MethodGet {
|
if via[0].Method == http.MethodGet {
|
||||||
return http.ErrUseLastResponse
|
return http.ErrUseLastResponse
|
||||||
}
|
}
|
||||||
|
@ -150,11 +154,11 @@ func CheckRedirect(req *http.Request, via []*http.Request) error {
|
||||||
// default API host and version. It also initializes the custom HTTP headers to
|
// default API host and version. It also initializes the custom HTTP headers to
|
||||||
// add to each request.
|
// add to each request.
|
||||||
//
|
//
|
||||||
// It takes an optional list of Opt functional arguments, which are applied in
|
// It takes an optional list of [Opt] functional arguments, which are applied in
|
||||||
// the order they're provided, which allows modifying the defaults when creating
|
// the order they're provided, which allows modifying the defaults when creating
|
||||||
// the client. For example, the following initializes a client that configures
|
// the client. For example, the following initializes a client that configures
|
||||||
// itself with values from environment variables (client.FromEnv), and has
|
// itself with values from environment variables ([FromEnv]), and has automatic
|
||||||
// automatic API version negotiation enabled (client.WithAPIVersionNegotiation()).
|
// API version negotiation enabled ([WithAPIVersionNegotiation]).
|
||||||
//
|
//
|
||||||
// cli, err := client.NewClientWithOpts(
|
// cli, err := client.NewClientWithOpts(
|
||||||
// client.FromEnv,
|
// client.FromEnv,
|
||||||
|
@ -185,16 +189,15 @@ func NewClientWithOpts(ops ...Opt) (*Client, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.scheme == "" {
|
if c.scheme == "" {
|
||||||
c.scheme = "http"
|
// TODO(stevvooe): This isn't really the right way to write clients in Go.
|
||||||
|
// `NewClient` should probably only take an `*http.Client` and work from there.
|
||||||
tlsConfig := resolveTLSConfig(c.client.Transport)
|
// Unfortunately, the model of having a host-ish/url-thingy as the connection
|
||||||
if tlsConfig != nil {
|
// string has us confusing protocol and transport layers. We continue doing
|
||||||
// TODO(stevvooe): This isn't really the right way to write clients in Go.
|
// this to avoid breaking existing clients but this should be addressed.
|
||||||
// `NewClient` should probably only take an `*http.Client` and work from there.
|
if c.tlsConfig() != nil {
|
||||||
// Unfortunately, the model of having a host-ish/url-thingy as the connection
|
|
||||||
// string has us confusing protocol and transport layers. We continue doing
|
|
||||||
// this to avoid breaking existing clients but this should be addressed.
|
|
||||||
c.scheme = "https"
|
c.scheme = "https"
|
||||||
|
} else {
|
||||||
|
c.scheme = "http"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +216,16 @@ func defaultHTTPClient(hostURL *url.URL) (*http.Client, error) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tlsConfig returns the TLS configuration from the client's transport.
|
||||||
|
// It returns nil if the transport is not a [http.Transport], or if no
|
||||||
|
// TLSClientConfig is set.
|
||||||
|
func (cli *Client) tlsConfig() *tls.Config {
|
||||||
|
if tr, ok := cli.client.Transport.(*http.Transport); ok {
|
||||||
|
return tr.TLSClientConfig
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Close the transport used by the client
|
// Close the transport used by the client
|
||||||
func (cli *Client) Close() error {
|
func (cli *Client) Close() error {
|
||||||
if t, ok := cli.client.Transport.(*http.Transport); ok {
|
if t, ok := cli.client.Transport.(*http.Transport); ok {
|
||||||
|
@ -221,7 +234,7 @@ func (cli *Client) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getAPIPath returns the versioned request path to call the api.
|
// getAPIPath returns the versioned request path to call the API.
|
||||||
// It appends the query parameters to the path if they are not empty.
|
// It appends the query parameters to the path if they are not empty.
|
||||||
func (cli *Client) getAPIPath(ctx context.Context, p string, query url.Values) string {
|
func (cli *Client) getAPIPath(ctx context.Context, p string, query url.Values) string {
|
||||||
var apiPath string
|
var apiPath string
|
||||||
|
@ -249,8 +262,8 @@ func (cli *Client) ClientVersion() string {
|
||||||
// by the client, it uses the client's maximum version.
|
// by the client, it uses the client's maximum version.
|
||||||
//
|
//
|
||||||
// If a manual override is in place, either through the "DOCKER_API_VERSION"
|
// If a manual override is in place, either through the "DOCKER_API_VERSION"
|
||||||
// (EnvOverrideAPIVersion) environment variable, or if the client is initialized
|
// ([EnvOverrideAPIVersion]) environment variable, or if the client is initialized
|
||||||
// with a fixed version (WithVersion(xx)), no negotiation is performed.
|
// with a fixed version ([WithVersion]), no negotiation is performed.
|
||||||
//
|
//
|
||||||
// If the API server's ping response does not contain an API version, or if the
|
// If the API server's ping response does not contain an API version, or if the
|
||||||
// client did not get a successful ping response, it assumes it is connected with
|
// client did not get a successful ping response, it assumes it is connected with
|
||||||
|
@ -270,8 +283,8 @@ func (cli *Client) NegotiateAPIVersion(ctx context.Context) {
|
||||||
// version.
|
// version.
|
||||||
//
|
//
|
||||||
// If a manual override is in place, either through the "DOCKER_API_VERSION"
|
// If a manual override is in place, either through the "DOCKER_API_VERSION"
|
||||||
// (EnvOverrideAPIVersion) environment variable, or if the client is initialized
|
// ([EnvOverrideAPIVersion]) environment variable, or if the client is initialized
|
||||||
// with a fixed version (WithVersion(xx)), no negotiation is performed.
|
// with a fixed version ([WithVersion]), no negotiation is performed.
|
||||||
//
|
//
|
||||||
// If the API server's ping response does not contain an API version, we assume
|
// If the API server's ping response does not contain an API version, we assume
|
||||||
// we are connected with an old daemon without API version negotiation support,
|
// we are connected with an old daemon without API version negotiation support,
|
||||||
|
@ -344,9 +357,10 @@ func ParseHostURL(host string) (*url.URL, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dialer returns a dialer for a raw stream connection, with an HTTP/1.1 header,
|
// Dialer returns a dialer for a raw stream connection, with an HTTP/1.1 header,
|
||||||
// that can be used for proxying the daemon connection.
|
// that can be used for proxying the daemon connection. It is used by
|
||||||
|
// ["docker dial-stdio"].
|
||||||
//
|
//
|
||||||
// Used by `docker dial-stdio` (docker/cli#889).
|
// ["docker dial-stdio"]: https://github.com/docker/cli/pull/1014
|
||||||
func (cli *Client) Dialer() func(context.Context) (net.Conn, error) {
|
func (cli *Client) Dialer() func(context.Context) (net.Conn, error) {
|
||||||
return func(ctx context.Context) (net.Conn, error) {
|
return func(ctx context.Context) (net.Conn, error) {
|
||||||
if transport, ok := cli.client.Transport.(*http.Transport); ok {
|
if transport, ok := cli.client.Transport.(*http.Transport); ok {
|
||||||
|
@ -354,6 +368,16 @@ func (cli *Client) Dialer() func(context.Context) (net.Conn, error) {
|
||||||
return transport.DialContext(ctx, cli.proto, cli.addr)
|
return transport.DialContext(ctx, cli.proto, cli.addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fallbackDial(cli.proto, cli.addr, resolveTLSConfig(cli.client.Transport))
|
switch cli.proto {
|
||||||
|
case "unix":
|
||||||
|
return net.Dial(cli.proto, cli.addr)
|
||||||
|
case "npipe":
|
||||||
|
return sockets.DialPipe(cli.addr, 32*time.Second)
|
||||||
|
default:
|
||||||
|
if tlsConfig := cli.tlsConfig(); tlsConfig != nil {
|
||||||
|
return tls.Dial(cli.proto, cli.addr, tlsConfig)
|
||||||
|
}
|
||||||
|
return net.Dial(cli.proto, cli.addr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,10 @@ func (cli *Client) ContainerStats(ctx context.Context, containerID string, strea
|
||||||
return types.ContainerStats{}, err
|
return types.ContainerStats{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
osType := getDockerOS(resp.header.Get("Server"))
|
return types.ContainerStats{
|
||||||
return types.ContainerStats{Body: resp.body, OSType: osType}, err
|
Body: resp.body,
|
||||||
|
OSType: getDockerOS(resp.header.Get("Server")),
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerStatsOneShot gets a single stat entry from a container.
|
// ContainerStatsOneShot gets a single stat entry from a container.
|
||||||
|
@ -37,6 +39,8 @@ func (cli *Client) ContainerStatsOneShot(ctx context.Context, containerID string
|
||||||
return types.ContainerStats{}, err
|
return types.ContainerStats{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
osType := getDockerOS(resp.header.Get("Server"))
|
return types.ContainerStats{
|
||||||
return types.ContainerStats{Body: resp.body, OSType: osType}, err
|
Body: resp.body,
|
||||||
|
OSType: getDockerOS(resp.header.Get("Server")),
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package client // import "github.com/docker/docker/client"
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -13,7 +12,6 @@ import (
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/versions"
|
"github.com/docker/docker/api/types/versions"
|
||||||
"github.com/docker/go-connections/sockets"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,14 +21,10 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
}
|
}
|
||||||
|
req, err := cli.buildRequest(http.MethodPost, cli.getAPIPath(ctx, path, query), bodyEncoded, headers)
|
||||||
apiPath := cli.getAPIPath(ctx, path, query)
|
|
||||||
req, err := http.NewRequest(http.MethodPost, apiPath, bodyEncoded)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
}
|
}
|
||||||
req = cli.addHeaders(req, headers)
|
|
||||||
|
|
||||||
conn, mediaType, err := cli.setupHijackConn(ctx, req, "tcp")
|
conn, mediaType, err := cli.setupHijackConn(ctx, req, "tcp")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
|
@ -51,24 +45,7 @@ func (cli *Client) DialHijack(ctx context.Context, url, proto string, meta map[s
|
||||||
return conn, err
|
return conn, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallbackDial is used when WithDialer() was not called.
|
|
||||||
// See cli.Dialer().
|
|
||||||
func fallbackDial(proto, addr string, tlsConfig *tls.Config) (net.Conn, error) {
|
|
||||||
if tlsConfig != nil && proto != "unix" && proto != "npipe" {
|
|
||||||
return tls.Dial(proto, addr, tlsConfig)
|
|
||||||
}
|
|
||||||
if proto == "npipe" {
|
|
||||||
return sockets.DialPipe(addr, 32*time.Second)
|
|
||||||
}
|
|
||||||
return net.Dial(proto, addr)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto string) (net.Conn, string, error) {
|
func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto string) (net.Conn, string, error) {
|
||||||
req.URL.Host = cli.addr
|
|
||||||
if cli.proto == "unix" || cli.proto == "npipe" {
|
|
||||||
// Override host header for non-tcp connections.
|
|
||||||
req.Host = DummyHost
|
|
||||||
}
|
|
||||||
req.Header.Set("Connection", "Upgrade")
|
req.Header.Set("Connection", "Upgrade")
|
||||||
req.Header.Set("Upgrade", proto)
|
req.Header.Set("Upgrade", proto)
|
||||||
|
|
||||||
|
@ -84,8 +61,8 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto
|
||||||
// state. Setting TCP KeepAlive on the socket connection will prohibit
|
// state. Setting TCP KeepAlive on the socket connection will prohibit
|
||||||
// ECONNTIMEOUT unless the socket connection truly is broken
|
// ECONNTIMEOUT unless the socket connection truly is broken
|
||||||
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
||||||
tcpConn.SetKeepAlive(true)
|
_ = tcpConn.SetKeepAlive(true)
|
||||||
tcpConn.SetKeepAlivePeriod(30 * time.Second)
|
_ = tcpConn.SetKeepAlivePeriod(30 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
clientconn := httputil.NewClientConn(conn, nil)
|
clientconn := httputil.NewClientConn(conn, nil)
|
||||||
|
@ -100,7 +77,7 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
if resp.StatusCode != http.StatusSwitchingProtocols {
|
if resp.StatusCode != http.StatusSwitchingProtocols {
|
||||||
resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
return nil, "", fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode)
|
return nil, "", fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,23 +13,22 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Opt is a configuration option to initialize a client
|
// Opt is a configuration option to initialize a [Client].
|
||||||
type Opt func(*Client) error
|
type Opt func(*Client) error
|
||||||
|
|
||||||
// FromEnv configures the client with values from environment variables.
|
// FromEnv configures the client with values from environment variables. It
|
||||||
|
// is the equivalent of using the [WithTLSClientConfigFromEnv], [WithHostFromEnv],
|
||||||
|
// and [WithVersionFromEnv] options.
|
||||||
//
|
//
|
||||||
// FromEnv uses the following environment variables:
|
// FromEnv uses the following environment variables:
|
||||||
//
|
//
|
||||||
// DOCKER_HOST (EnvOverrideHost) to set the URL to the docker server.
|
// - DOCKER_HOST ([EnvOverrideHost]) to set the URL to the docker server.
|
||||||
//
|
// - DOCKER_API_VERSION ([EnvOverrideAPIVersion]) to set the version of the
|
||||||
// DOCKER_API_VERSION (EnvOverrideAPIVersion) to set the version of the API to
|
// API to use, leave empty for latest.
|
||||||
// use, leave empty for latest.
|
// - DOCKER_CERT_PATH ([EnvOverrideCertPath]) to specify the directory from
|
||||||
//
|
// which to load the TLS certificates ("ca.pem", "cert.pem", "key.pem').
|
||||||
// DOCKER_CERT_PATH (EnvOverrideCertPath) to specify the directory from which to
|
// - DOCKER_TLS_VERIFY ([EnvTLSVerify]) to enable or disable TLS verification
|
||||||
// load the TLS certificates (ca.pem, cert.pem, key.pem).
|
// (off by default).
|
||||||
//
|
|
||||||
// DOCKER_TLS_VERIFY (EnvTLSVerify) to enable or disable TLS verification (off by
|
|
||||||
// default).
|
|
||||||
func FromEnv(c *Client) error {
|
func FromEnv(c *Client) error {
|
||||||
ops := []Opt{
|
ops := []Opt{
|
||||||
WithTLSClientConfigFromEnv(),
|
WithTLSClientConfigFromEnv(),
|
||||||
|
@ -45,7 +44,8 @@ func FromEnv(c *Client) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithDialContext applies the dialer to the client transport. This can be
|
// WithDialContext applies the dialer to the client transport. This can be
|
||||||
// used to set the Timeout and KeepAlive settings of the client.
|
// used to set the Timeout and KeepAlive settings of the client. It returns
|
||||||
|
// an error if the client does not have a [http.Transport] configured.
|
||||||
func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) Opt {
|
func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
if transport, ok := c.client.Transport.(*http.Transport); ok {
|
if transport, ok := c.client.Transport.(*http.Transport); ok {
|
||||||
|
@ -75,7 +75,7 @@ func WithHost(host string) Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithHostFromEnv overrides the client host with the host specified in the
|
// WithHostFromEnv overrides the client host with the host specified in the
|
||||||
// DOCKER_HOST (EnvOverrideHost) environment variable. If DOCKER_HOST is not set,
|
// DOCKER_HOST ([EnvOverrideHost]) environment variable. If DOCKER_HOST is not set,
|
||||||
// or set to an empty value, the host is not modified.
|
// or set to an empty value, the host is not modified.
|
||||||
func WithHostFromEnv() Opt {
|
func WithHostFromEnv() Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
|
@ -86,7 +86,7 @@ func WithHostFromEnv() Opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithHTTPClient overrides the client http client with the specified one
|
// WithHTTPClient overrides the client's HTTP client with the specified one.
|
||||||
func WithHTTPClient(client *http.Client) Opt {
|
func WithHTTPClient(client *http.Client) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
if client != nil {
|
if client != nil {
|
||||||
|
@ -96,7 +96,7 @@ func WithHTTPClient(client *http.Client) Opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTimeout configures the time limit for requests made by the HTTP client
|
// WithTimeout configures the time limit for requests made by the HTTP client.
|
||||||
func WithTimeout(timeout time.Duration) Opt {
|
func WithTimeout(timeout time.Duration) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.client.Timeout = timeout
|
c.client.Timeout = timeout
|
||||||
|
@ -114,7 +114,9 @@ func WithUserAgent(ua string) Opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithHTTPHeaders overrides the client default http headers
|
// WithHTTPHeaders appends custom HTTP headers to the client's default headers.
|
||||||
|
// It does not allow for built-in headers (such as "User-Agent", if set) to
|
||||||
|
// be overridden. Also see [WithUserAgent].
|
||||||
func WithHTTPHeaders(headers map[string]string) Opt {
|
func WithHTTPHeaders(headers map[string]string) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.customHTTPHeaders = headers
|
c.customHTTPHeaders = headers
|
||||||
|
@ -122,7 +124,7 @@ func WithHTTPHeaders(headers map[string]string) Opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithScheme overrides the client scheme with the specified one
|
// WithScheme overrides the client scheme with the specified one.
|
||||||
func WithScheme(scheme string) Opt {
|
func WithScheme(scheme string) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.scheme = scheme
|
c.scheme = scheme
|
||||||
|
@ -130,51 +132,50 @@ func WithScheme(scheme string) Opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTLSClientConfig applies a tls config to the client transport.
|
// WithTLSClientConfig applies a TLS config to the client transport.
|
||||||
func WithTLSClientConfig(cacertPath, certPath, keyPath string) Opt {
|
func WithTLSClientConfig(cacertPath, certPath, keyPath string) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
opts := tlsconfig.Options{
|
transport, ok := c.client.Transport.(*http.Transport)
|
||||||
|
if !ok {
|
||||||
|
return errors.Errorf("cannot apply tls config to transport: %T", c.client.Transport)
|
||||||
|
}
|
||||||
|
config, err := tlsconfig.Client(tlsconfig.Options{
|
||||||
CAFile: cacertPath,
|
CAFile: cacertPath,
|
||||||
CertFile: certPath,
|
CertFile: certPath,
|
||||||
KeyFile: keyPath,
|
KeyFile: keyPath,
|
||||||
ExclusiveRootPools: true,
|
ExclusiveRootPools: true,
|
||||||
}
|
})
|
||||||
config, err := tlsconfig.Client(opts)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to create tls config")
|
return errors.Wrap(err, "failed to create tls config")
|
||||||
}
|
}
|
||||||
if transport, ok := c.client.Transport.(*http.Transport); ok {
|
transport.TLSClientConfig = config
|
||||||
transport.TLSClientConfig = config
|
return nil
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return errors.Errorf("cannot apply tls config to transport: %T", c.client.Transport)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithTLSClientConfigFromEnv configures the client's TLS settings with the
|
// WithTLSClientConfigFromEnv configures the client's TLS settings with the
|
||||||
// settings in the DOCKER_CERT_PATH and DOCKER_TLS_VERIFY environment variables.
|
// settings in the DOCKER_CERT_PATH ([EnvOverrideCertPath]) and DOCKER_TLS_VERIFY
|
||||||
// If DOCKER_CERT_PATH is not set or empty, TLS configuration is not modified.
|
// ([EnvTLSVerify]) environment variables. If DOCKER_CERT_PATH is not set or empty,
|
||||||
|
// TLS configuration is not modified.
|
||||||
//
|
//
|
||||||
// WithTLSClientConfigFromEnv uses the following environment variables:
|
// WithTLSClientConfigFromEnv uses the following environment variables:
|
||||||
//
|
//
|
||||||
// DOCKER_CERT_PATH (EnvOverrideCertPath) to specify the directory from which to
|
// - DOCKER_CERT_PATH ([EnvOverrideCertPath]) to specify the directory from
|
||||||
// load the TLS certificates (ca.pem, cert.pem, key.pem).
|
// which to load the TLS certificates ("ca.pem", "cert.pem", "key.pem").
|
||||||
//
|
// - DOCKER_TLS_VERIFY ([EnvTLSVerify]) to enable or disable TLS verification
|
||||||
// DOCKER_TLS_VERIFY (EnvTLSVerify) to enable or disable TLS verification (off by
|
// (off by default).
|
||||||
// default).
|
|
||||||
func WithTLSClientConfigFromEnv() Opt {
|
func WithTLSClientConfigFromEnv() Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
dockerCertPath := os.Getenv(EnvOverrideCertPath)
|
dockerCertPath := os.Getenv(EnvOverrideCertPath)
|
||||||
if dockerCertPath == "" {
|
if dockerCertPath == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
options := tlsconfig.Options{
|
tlsc, err := tlsconfig.Client(tlsconfig.Options{
|
||||||
CAFile: filepath.Join(dockerCertPath, "ca.pem"),
|
CAFile: filepath.Join(dockerCertPath, "ca.pem"),
|
||||||
CertFile: filepath.Join(dockerCertPath, "cert.pem"),
|
CertFile: filepath.Join(dockerCertPath, "cert.pem"),
|
||||||
KeyFile: filepath.Join(dockerCertPath, "key.pem"),
|
KeyFile: filepath.Join(dockerCertPath, "key.pem"),
|
||||||
InsecureSkipVerify: os.Getenv(EnvTLSVerify) == "",
|
InsecureSkipVerify: os.Getenv(EnvTLSVerify) == "",
|
||||||
}
|
})
|
||||||
tlsc, err := tlsconfig.Client(options)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -188,7 +189,8 @@ func WithTLSClientConfigFromEnv() Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithVersion overrides the client version with the specified one. If an empty
|
// WithVersion overrides the client version with the specified one. If an empty
|
||||||
// version is specified, the value will be ignored to allow version negotiation.
|
// version is provided, the value is ignored to allow version negotiation
|
||||||
|
// (see [WithAPIVersionNegotiation]).
|
||||||
func WithVersion(version string) Opt {
|
func WithVersion(version string) Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
if version != "" {
|
if version != "" {
|
||||||
|
@ -200,8 +202,9 @@ func WithVersion(version string) Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithVersionFromEnv overrides the client version with the version specified in
|
// WithVersionFromEnv overrides the client version with the version specified in
|
||||||
// the DOCKER_API_VERSION environment variable. If DOCKER_API_VERSION is not set,
|
// the DOCKER_API_VERSION ([EnvOverrideAPIVersion]) environment variable.
|
||||||
// the version is not modified.
|
// If DOCKER_API_VERSION is not set, or set to an empty value, the version
|
||||||
|
// is not modified.
|
||||||
func WithVersionFromEnv() Opt {
|
func WithVersionFromEnv() Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
return WithVersion(os.Getenv(EnvOverrideAPIVersion))(c)
|
return WithVersion(os.Getenv(EnvOverrideAPIVersion))(c)
|
||||||
|
@ -211,7 +214,7 @@ func WithVersionFromEnv() Opt {
|
||||||
// WithAPIVersionNegotiation enables automatic API version negotiation for the client.
|
// WithAPIVersionNegotiation enables automatic API version negotiation for the client.
|
||||||
// With this option enabled, the client automatically negotiates the API version
|
// With this option enabled, the client automatically negotiates the API version
|
||||||
// to use when making requests. API version negotiation is performed on the first
|
// to use when making requests. API version negotiation is performed on the first
|
||||||
// request; subsequent requests will not re-negotiate.
|
// request; subsequent requests do not re-negotiate.
|
||||||
func WithAPIVersionNegotiation() Opt {
|
func WithAPIVersionNegotiation() Opt {
|
||||||
return func(c *Client) error {
|
return func(c *Client) error {
|
||||||
c.negotiateVersion = true
|
c.negotiateVersion = true
|
||||||
|
|
|
@ -227,13 +227,8 @@ func (cli *Client) checkResponseErr(serverResp serverResponse) error {
|
||||||
return fmt.Errorf("request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(serverResp.statusCode), serverResp.reqURL)
|
return fmt.Errorf("request returned %s for API route and version %s, check if the server supports the requested API version", http.StatusText(serverResp.statusCode), serverResp.reqURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ct string
|
|
||||||
if serverResp.header != nil {
|
|
||||||
ct = serverResp.header.Get("Content-Type")
|
|
||||||
}
|
|
||||||
|
|
||||||
var errorMessage string
|
var errorMessage string
|
||||||
if (cli.version == "" || versions.GreaterThan(cli.version, "1.23")) && ct == "application/json" {
|
if serverResp.header.Get("Content-Type") == "application/json" && (cli.version == "" || versions.GreaterThan(cli.version, "1.23")) {
|
||||||
var errorResponse types.ErrorResponse
|
var errorResponse types.ErrorResponse
|
||||||
if err := json.Unmarshal(body, &errorResponse); err != nil {
|
if err := json.Unmarshal(body, &errorResponse); err != nil {
|
||||||
return errors.Wrap(err, "Error reading JSON")
|
return errors.Wrap(err, "Error reading JSON")
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
package client // import "github.com/docker/docker/client"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/tls"
|
|
||||||
"net/http"
|
|
||||||
)
|
|
||||||
|
|
||||||
// resolveTLSConfig attempts to resolve the TLS configuration from the
|
|
||||||
// RoundTripper.
|
|
||||||
func resolveTLSConfig(transport http.RoundTripper) *tls.Config {
|
|
||||||
switch tr := transport.(type) {
|
|
||||||
case *http.Transport:
|
|
||||||
return tr.TLSClientConfig
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -30,7 +30,6 @@ import (
|
||||||
"github.com/moby/patternmatcher"
|
"github.com/moby/patternmatcher"
|
||||||
"github.com/moby/sys/sequential"
|
"github.com/moby/sys/sequential"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ImpliedDirectoryMode represents the mode (Unix permissions) applied to directories that are implied by files in a
|
// ImpliedDirectoryMode represents the mode (Unix permissions) applied to directories that are implied by files in a
|
||||||
|
@ -790,7 +789,7 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, o
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(xattrErrs) > 0 {
|
if len(xattrErrs) > 0 {
|
||||||
log.G(context.TODO()).WithFields(logrus.Fields{
|
log.G(context.TODO()).WithFields(log.Fields{
|
||||||
"errors": xattrErrs,
|
"errors": xattrErrs,
|
||||||
}).Warn("ignored xattrs in archive: underlying filesystem doesn't support them")
|
}).Warn("ignored xattrs in archive: underlying filesystem doesn't support them")
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -43,6 +44,20 @@ func chmodTarEntry(perm os.FileMode) os.FileMode {
|
||||||
// statUnix populates hdr from system-dependent fields of fi without performing
|
// statUnix populates hdr from system-dependent fields of fi without performing
|
||||||
// any OS lookups.
|
// any OS lookups.
|
||||||
func statUnix(fi os.FileInfo, hdr *tar.Header) error {
|
func statUnix(fi os.FileInfo, hdr *tar.Header) error {
|
||||||
|
// Devmajor and Devminor are only needed for special devices.
|
||||||
|
|
||||||
|
// In FreeBSD, RDev for regular files is -1 (unless overridden by FS):
|
||||||
|
// https://cgit.freebsd.org/src/tree/sys/kern/vfs_default.c?h=stable/13#n1531
|
||||||
|
// (NODEV is -1: https://cgit.freebsd.org/src/tree/sys/sys/param.h?h=stable/13#n241).
|
||||||
|
|
||||||
|
// ZFS in particular does not override the default:
|
||||||
|
// https://cgit.freebsd.org/src/tree/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c?h=stable/13#n2027
|
||||||
|
|
||||||
|
// Since `Stat_t.Rdev` is uint64, the cast turns -1 into (2^64 - 1).
|
||||||
|
// Such large values cannot be encoded in a tar header.
|
||||||
|
if runtime.GOOS == "freebsd" && hdr.Typeflag != tar.TypeBlock && hdr.Typeflag != tar.TypeChar {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
s, ok := fi.Sys().(*syscall.Stat_t)
|
s, ok := fi.Sys().(*syscall.Stat_t)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
package registry // import "github.com/docker/docker/registry"
|
package registry // import "github.com/docker/docker/registry"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
"github.com/docker/docker/api/types/registry"
|
"github.com/docker/docker/api/types/registry"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServiceOptions holds command line options.
|
// ServiceOptions holds command line options.
|
||||||
|
@ -197,10 +198,10 @@ skip:
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(strings.ToLower(r), "http://") {
|
if strings.HasPrefix(strings.ToLower(r), "http://") {
|
||||||
logrus.Warnf("insecure registry %s should not contain 'http://' and 'http://' has been removed from the insecure registry config", r)
|
log.G(context.TODO()).Warnf("insecure registry %s should not contain 'http://' and 'http://' has been removed from the insecure registry config", r)
|
||||||
r = r[7:]
|
r = r[7:]
|
||||||
} else if strings.HasPrefix(strings.ToLower(r), "https://") {
|
} else if strings.HasPrefix(strings.ToLower(r), "https://") {
|
||||||
logrus.Warnf("insecure registry %s should not contain 'https://' and 'https://' has been removed from the insecure registry config", r)
|
log.G(context.TODO()).Warnf("insecure registry %s should not contain 'https://' and 'https://' has been removed from the insecure registry config", r)
|
||||||
r = r[8:]
|
r = r[8:]
|
||||||
} else if hasScheme(r) {
|
} else if hasScheme(r) {
|
||||||
return invalidParamf("insecure registry %s should not contain '://'", r)
|
return invalidParamf("insecure registry %s should not contain '://'", r)
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var acceptedSearchFilterTags = map[string]bool{
|
var acceptedSearchFilterTags = map[string]bool{
|
||||||
"is-automated": true,
|
"is-automated": true, // Deprecated: the "is_automated" field is deprecated and will always be false in the future.
|
||||||
"is-official": true,
|
"is-official": true,
|
||||||
"stars": true,
|
"stars": true,
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ func (s *Service) Search(ctx context.Context, searchFilters filters.Args, term s
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(thaJeztah): the "is-automated" field is deprecated; reset the field for the next release (v26.0.0). Return early when using "is-automated=true", and ignore "is-automated=false".
|
||||||
isAutomated, err := searchFilters.GetBoolOrDefault("is-automated", false)
|
isAutomated, err := searchFilters.GetBoolOrDefault("is-automated", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -51,6 +52,7 @@ func (s *Service) Search(ctx context.Context, searchFilters filters.Args, term s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(thaJeztah): the "is-automated" field is deprecated. Reset the field for the next release (v26.0.0) if any "true" values are present.
|
||||||
unfilteredResult, err := s.searchUnfiltered(ctx, term, limit, authConfig, headers)
|
unfilteredResult, err := s.searchUnfiltered(ctx, term, limit, authConfig, headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -59,7 +61,7 @@ func (s *Service) Search(ctx context.Context, searchFilters filters.Args, term s
|
||||||
filteredResults := []registry.SearchResult{}
|
filteredResults := []registry.SearchResult{}
|
||||||
for _, result := range unfilteredResult.Results {
|
for _, result := range unfilteredResult.Results {
|
||||||
if searchFilters.Contains("is-automated") {
|
if searchFilters.Contains("is-automated") {
|
||||||
if isAutomated != result.IsAutomated {
|
if isAutomated != result.IsAutomated { //nolint:staticcheck // ignore SA1019 for old API versions.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ github.com/docker/distribution/registry/client/transport
|
||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v24.0.0-rc.2.0.20230714195812-dab9ffb25218+incompatible
|
# github.com/docker/docker v24.0.0-rc.2.0.20230807181406-4b19b2f4babd+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
|
|
Loading…
Reference in New Issue