-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad exit status for docker system info on failure #5900
Comments
Thanks for reporting; this looks be related to the DOCKER_HOST=unix:///non-existent docker system info --format '{{.Architecture}}'
echo $?
0
DOCKER_HOST=unix:///non-existent docker system info
# (output omitted)
echo $?
1 I know there's some code in this area that tries to parse the template to detect whether a daemon connection is required (so that client-side |
If you only need the architecture (and/or OS), I would recommend using docker version --format='{{.Server.Arch}}'
arm64
docker version --format='{{.Server.Os}}'
linux The architecture returned there is using the formats used by Golang's GOOS, which also matches the format used for platform strings in OCI images. Comparison in time taken for both; $ time docker version --format='{{.Server.Arch}}'
arm64
real 0m0.040s
user 0m0.011s
sys 0m0.008s
$ time docker info --format='{{.Architecture}}'
aarch64
real 0m0.272s
user 0m0.158s
sys 0m0.391s |
I see what the issue is here, the |
Ah! Yes, looks indeed in one of the areas I had in mind. It's a bit gnarly for sure; I think it was in an attempt to make the |
Description
docker system info
returns 0 (success) even on failures.Reproduce
Expected behavior
on failures, any exit value other than 0 would be appropriate.
docker version
Client: Docker Engine - Community Version: 28.0.1 API version: 1.48 Go version: go1.23.6 Git commit: 068a01e Built: Wed Feb 26 10:41:12 2025 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 28.0.1 API version: 1.48 (minimum version 1.24) Go version: go1.23.6 Git commit: bbd0a17 Built: Wed Feb 26 10:41:12 2025 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.25 GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb runc: Version: 1.2.4 GitCommit: v1.2.4-0-g6c52b3f docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
I'm attempting to use this to manage a dev container, and define the architecture, but when it fails... it is hard to know, and unexpected behaviour happens down the line.
The text was updated successfully, but these errors were encountered: