Skip to content
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

Make "docker buildx inspect" return a json string like other inspect commands in docker #381

Open
gabrieldemarmiesse opened this issue Sep 4, 2020 · 2 comments
Labels
kind/enhancement New feature or request

Comments

@gabrieldemarmiesse
Copy link

Same reasons as #380 , for a third party lib, it's much easier to work with.

$ docker network inspect ffb3f184cd0a
[
    {
        "Name": "host",
        "Id": "ffb3f184cd0a2077f75a507320a9613eec135dc6cb234340ea924d576215e96e",
        "Created": "2020-05-04T17:50:40.0997657+02:00",
        "Scope": "local",
        "Driver": "host",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": []
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "a8d13ad9ac75a3343da098003e22052ac6ada63fa03a216e96f549f636b5ab56": {
                "Name": "gabriel_work_env",
                "EndpointID": "fe22d2b01c99eca9992079cfe1bc04774d9f1e29c4c161808273a286cc018ae7",
                "MacAddress": "",
                "IPv4Address": "",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]
$ docker buildx inspect blissful_swartz
Name:   blissful_swartz
Driver: docker-container

Nodes:
Name:      blissful_swartz0
Endpoint:  unix:///var/run/docker.sock
Status:    inactive
Platforms:
@gabrieldemarmiesse
Copy link
Author

FYI docker buildx ls --format "{{json . }}" is now allowed, it duplicates some results and there is no way to know the current builder from the output, but it's still a nice improvement.

@thaJeztah
Copy link
Member

I think it would make sense to add a --format flag here as well that supports --format=json (shortcut for --format '{{json .}}). wdyt @crazy-max ?

It's indeed not consistent with other commands, but I think the ship has sailed changing the default.

FWIW, we have been discussing introducing a new set of info (or view) subcommands to be used as a "human friendly" counterpart of inspect. While the inspect output can be useful for scripting, it's not very readable for humans. For that reason we're considering info commands that would output the information in a more opinionated, readable format. Such commands also gives us more flexibility to make improvements to the output without breaking scripts (as the output would, by design, not be intended for scripting / parsing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants