mirror of https://github.com/docker/cli.git
9dc54f3fbe
Before this patch, the Server output would be printed even if we failed to connect (including WARNINGS): ```bash docker -H tcp://127.0.0.1:2375 info Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running? Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc., v0.8.2) compose: Docker Compose (Docker Inc., v2.4.1) sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0) scan: Docker Scan (Docker Inc., v0.17.0) Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Plugins: Volume: Network: Log: Swarm: NodeID: Is Manager: false Node Address: CPUs: 0 Total Memory: 0B Docker Root Dir: Debug Mode: false Experimental: false Live Restore Enabled: false 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 ERROR: Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running? errors pretty printing info ``` With this patch; ```bash docker -H tcp://127.0.0.1:2375 info Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc., v0.8.2) compose: Docker Compose (Docker Inc., v2.4.1) sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0) scan: Docker Scan (Docker Inc., v0.17.0) Server: ERROR: Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running? errors pretty printing info ``` And if a custom format is used: ```bash docker -H tcp://127.0.0.1:2375 info --format '{{.Containers}}' Cannot connect to the Docker daemon at tcp://127.0.0.1:2375. Is the docker daemon running? 0 ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
builder | ||
checkpoint | ||
commands | ||
config | ||
container | ||
context | ||
formatter | ||
idresolver | ||
image | ||
inspect | ||
manifest | ||
network | ||
node | ||
plugin | ||
registry | ||
secret | ||
service | ||
stack | ||
swarm | ||
system | ||
task | ||
testdata | ||
trust | ||
volume | ||
cli.go | ||
cli_options.go | ||
cli_options_test.go | ||
cli_test.go | ||
context.go | ||
context_test.go | ||
defaultcontextstore.go | ||
defaultcontextstore_test.go | ||
events_utils.go | ||
registry.go | ||
registry_test.go | ||
streams.go | ||
trust.go | ||
utils.go | ||
utils_test.go |