Skip to content

The buildx inspect command is missing #13014

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

Open
joshbode opened this issue Jan 26, 2022 · 15 comments · May be fixed by #26232
Open

The buildx inspect command is missing #13014

joshbode opened this issue Jan 26, 2022 · 15 comments · May be fixed by #26232
Labels
jira kind/feature Categorizes issue or PR as related to a new feature.

Comments

@joshbode
Copy link

/kind feature

Description

I am looking into whether it is possible to use Podman as a replacement for Docker with Python on Whales, a Python wrapper for the Docker CLI.

Things look great so far, however, one issue I discovered is that Podman doesn't implement the buildx inspect sub-command. The output of this command is parsed by python_on_whales and the required fields in the the output are Name and Driver (see https://github.com/gabrieldemarmiesse/python-on-whales/blob/4d5b8b4c5c6dc3ac0af5713e4fe5a72788f44cda/python_on_whales/components/buildx/models.py#L12)

Steps to reproduce the issue:

  1. Run podman buildx inspect

Describe the results you received:

$ podman buildx inspect

Error: unrecognized command `podman buildx inspect`
Try 'podman buildx --help' for more information.

Describe the results you expected:

This is the equivalent output from docker:

$ docker buildx inspect
Name:   default
Driver: docker

Nodes:
Name:      default
Endpoint:  default
Status:    running
Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

Output of podman version:

$ podman version
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.16.13
Built:        Tue Jan  1 11:00:00 1980
OS/Arch:      linux/amd64

Output of podman info --debug:

$ podman info --debug
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: Unknown
    path: /nix/store/vpxdfaxp4jl64d6qrhpc23w3a0qr96ml-conmon-2.0.32/bin/conmon
    version: 'conmon version 2.0.32, commit: '
  cpus: 8
  distribution:
    codename: impish
    distribution: ubuntu
    version: "21.10"
  eventLogger: journald
  hostname: kruppe
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.13.0-27-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 1253212160
  memTotal: 16422072320
  ociRuntime:
    name: crun
    package: Unknown
    path: /nix/store/amzakhsy7nvq0d9cx352wlv9h4w2fbrr-crun-1.4.1/bin/crun
    version: |-
      crun version 1.4.1
      commit: 1.4.1
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: ""
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /nix/store/svfg9bk10x432b4p8napxkhzrv93wizf-slirp4netns-1.1.12/bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.2
  swapFree: 2131079168
  swapTotal: 2147479552
  uptime: 4h 7m 22.79s (Approximately 0.17 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /home/josh/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /nix/store/p8sprv2pgkdvrylrvmbhk2njhgclz6nl-fuse-overlayfs-1.8.1/bin/fuse-overlayfs
      Package: Unknown
      Version: |-
        fuse-overlayfs: version 1.8.1
        FUSE library version 3.10.5
        using FUSE kernel interface version 7.31
  graphRoot: /home/josh/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: zfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 13
  runRoot: /run/user/1000/containers
  volumePath: /home/josh/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 315532800
  BuiltTime: Tue Jan  1 11:00:00 1980
  GitCommit: ""
  GoVersion: go1.16.13
  OsArch: linux/amd64
  Version: 3.4.4

Package info (e.g. output of rpm -q podman or apt list podman):

$ nix-env --query --json podman-wrapper

{
  "1": {
    "name": "podman-wrapper-3.4.4",
    "pname": "podman-wrapper",
    "version": "3.4.4",
    "system": "x86_64-linux",
    "meta": {
      "available": true,
      "broken": false,
      "changelog": "https://github.com/containers/podman/blob/v3.4.4/changelog.txt",
      "description": "A program for managing pods, containers and container images",
      "homepage": "https://podman.io/",
      "insecure": false,
      "license": {
        "deprecated": false,
        "free": true,
        "fullName": "Apache License 2.0",
        "redistributable": true,
        "shortName": "asl20",
        "spdxId": "Apache-2.0",
        "url": "https://spdx.org/licenses/Apache-2.0.html"
      },
      "maintainers": [
        {
          "email": "[email protected]",
          "github": "marsam",
          "githubId": 65531,
          "name": "Mario Rodas"
        },
        {
          "email": "[email protected]",
          "github": "adisbladis",
          "githubId": 63286,
          "matrix": "@adis:blad.is",
          "name": "Adam Hose"
        },
        {
          "email": "[email protected]",
          "github": "saschagrunert",
          "githubId": 695473,
          "name": "Sascha Grunert"
        },
        {
          "email": "[email protected]",
          "github": "vdemeester",
          "githubId": 6508,
          "name": "Vincent Demeester"
        },
        {
          "email": "[email protected]",
          "github": "zowoq",
          "githubId": 59103226,
          "name": "zowoq"
        },
        {
          "email": "[email protected]",
          "github": "kalbasit",
          "githubId": 87115,
          "matrix": "@kalbasit:matrix.org",
          "name": "Wael Nasreddine"
        }
      ],
      "name": "podman-3.4.4",
      "outputsToInstall": [
        "out",
        "man"
      ],
      "platforms": [
        "i686-cygwin",
        "x86_64-cygwin",
        "x86_64-darwin",
        "i686-darwin",
        "aarch64-darwin",
        "armv7a-darwin",
        "i686-freebsd",
        "x86_64-freebsd",
        "x86_64-solaris",
        "aarch64-linux",
        "armv5tel-linux",
        "armv6l-linux",
        "armv7a-linux",
        "armv7l-linux",
        "i686-linux",
        "m68k-linux",
        "mipsel-linux",
        "powerpc64-linux",
        "powerpc64le-linux",
        "riscv32-linux",
        "riscv64-linux",
        "s390-linux",
        "s390x-linux",
        "x86_64-linux",
        "aarch64-netbsd",
        "armv6l-netbsd",
        "armv7a-netbsd",
        "armv7l-netbsd",
        "i686-netbsd",
        "m68k-netbsd",
        "mipsel-netbsd",
        "powerpc-netbsd",
        "riscv32-netbsd",
        "riscv64-netbsd",
        "x86_64-netbsd",
        "i686-openbsd",
        "x86_64-openbsd",
        "x86_64-redox"
      ],
      "position": "/nix/store/j5qs10s8p002r50jhd3p0jnxpgwd4np5-nixpkgs-22.05pre348320.cc68710784f/nixpkgs/pkgs/applications/virtualization/podman/default.nix:89",
      "unfree": false,
      "unsupported": false
    }
  }
}
@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 26, 2022
@zhangguanzhang
Copy link
Collaborator

@joshbode
Copy link
Author

Ah! Thank you - I should have checked that first. I'm on the latest release but it looks like the command will be there soon.

@joshbode
Copy link
Author

Although, I can't see anything in the release notes (or source) relating to podman buildx inspect (only podman buildx build and podman buildx prune)

@joshbode joshbode reopened this Jan 26, 2022
@jmontleon
Copy link

jmontleon commented Jan 26, 2022

inspect is still unavailable thus far. We hit it with velero while testing to see if we could build with podman instead of docker. Their Makefile is using inspect to check if buildx is enabled.

https://github.com/vmware-tanzu/velero/blob/main/Makefile#L73-L77

For velero it is easy enough to workaround by running export BUILDX_ENABLED=true

Other than this and containers/buildah#3799 it does work though.

@rhatdan
Copy link
Member

rhatdan commented Jan 26, 2022

Is docker buildx inspect the same as docker image inspect or docker inspect?

@rhatdan
Copy link
Member

rhatdan commented Jan 26, 2022

Could you append the output of docker buildx inspect?

@jmontleon
Copy link

jmontleon commented Jan 26, 2022

# docker inspect
"docker inspect" requires at least 1 argument.
See 'docker inspect --help'.

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects
# docker inspect --help

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects

Options:
  -f, --format string   Format the output using the given Go template
  -s, --size            Display total file sizes if the type is container
      --type string     Return JSON for specified type
# docker buildx inspect
Name:   default
Driver: docker

Nodes:
Name:      default
Endpoint:  default
Status:    running
Platforms: linux/amd64, linux/386
# docker buildx inspect --help

Usage:  docker buildx inspect [NAME]

Inspect current builder instance

Options:
      --bootstrap        Ensure builder has booted before inspecting
      --builder string   Override the configured builder instance

@jmontleon
Copy link

Sorry, I missed docker image inspect

$ docker image inspect
"docker image inspect" requires at least 1 argument.
See 'docker image inspect --help'.

Usage:  docker image inspect [OPTIONS] IMAGE [IMAGE...]

Display detailed information on one or more images
$ docker image inspect --help

Usage:  docker image inspect [OPTIONS] IMAGE [IMAGE...]

Display detailed information on one or more images

Options:
  -f, --format string   Format the output using the given Go template

@AkihiroSuda
Copy link
Collaborator

docker buildx inspect is for inspecting BuildKit daemons.
Doesn’t make sense for Podman (unless Podman adopts BuildKit)

@rhatdan
Copy link
Member

rhatdan commented Jan 31, 2022

We don't plan on doing this at this time, the question is could we implement parts of buildx, to make switching scripts from one tool to another easier.

@jmontleon
Copy link

If you can't implement buildx inspect, which upstream projects are using to determine if the buildx plugin is installed and enabled in docker, do you have a recommendation on how such a check might be implemented so that it works universally? Otherwise between this and the issue related to not handling the output flag it gets more difficult using podman as a replacement in conjunction with projects where you don't control the source.

@flouthoc
Copy link
Collaborator

buildx inspect is not applicable for podman. buildx inspect specifically tells about builder daemon instances I don't think there are any plans for podman to use buildkit daemon as of now, instead podman uses buildah which implements part of buildkit features which is not invoked as a daemon.

We can implement a dummy output for buildx inspect so it does not breaks the systems which are planning to use podman as a replacement, but I'm not sure if its a good idea.

I am closing this issue since it falls more into category of NA for podman as of now. But feel free to continue discussion below.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
@vrothberg
Copy link
Member

Reopening as a user asked to.

@vrothberg vrothberg reopened this Mar 25, 2024
@containers containers unlocked this conversation Mar 25, 2024
@kaovilai
Copy link

kaovilai commented Mar 25, 2024

Dummy outputs is acceptable imo as long as it’s documented in migration docs etc.

This ack could be generated by
podman buildx-compat enable-dummy-inspect

Could be explicit ack in some config file manually as well.

This should make any systems using inspect command to assume buildx is enabled and to proceed using other buildx commands like buildx build.

Any buildx subcommands not supported will explicitly be printed out as part of this ack command.

@kaovilai
Copy link

There should be some non dummy data as part of this output, such as supported platforms that podman can output.

@Luap99 Luap99 removed the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Apr 4, 2024
2004joshua pushed a commit to 2004joshua/podman that referenced this issue May 28, 2025
I added support for "podman buildx inspect" It supports issue containers#13014. Since podman doesn't
support Buildkit the version was ignored. For platforms both emulated and host platforms was
included while the rest became normal prints meant to replicate what "docker buildx inspect"
returned. I also added support for the "--bootstrap" flag that corresponds to the docker command.
So far this is considered a NOP so it returns the same output as though it wasn't there.
This file can be found in cmd/podman/images/buildx_inspect.go and test can be found at
test/e2e/buildx_inspect_test.go

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua pushed a commit to 2004joshua/podman that referenced this issue May 29, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
@2004joshua 2004joshua linked a pull request May 29, 2025 that will close this issue
2004joshua added a commit to 2004joshua/podman that referenced this issue May 29, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua added a commit to 2004joshua/podman that referenced this issue May 29, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua added a commit to 2004joshua/podman that referenced this issue May 29, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
@mheon mheon added the jira label May 29, 2025
2004joshua added a commit to 2004joshua/podman that referenced this issue May 30, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua added a commit to 2004joshua/podman that referenced this issue May 30, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua added a commit to 2004joshua/podman that referenced this issue May 30, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
2004joshua added a commit to 2004joshua/podman that referenced this issue May 31, 2025
Added support for "podman buildx inspect". The goal was to replicate the default output from "docker buildx inspect" as
much as possible but a problem encountered was podman not supporting BuildKit. To replicate the output I resorted to
printing the statements with default values but only changed the driver name to use podman instead of docker. Since
there was no buildkit, gave it the value of "N/A" to depict it's not supported. For Platforms, I resorted to using
the emulated architectures found on your linux system + the host architecture of your local machine or podman server. The
bootstrap flag was also added but is considered a NOP since there is no buildkit container to run before running inspect.
An extra field was added to the HostInfo struct so when you run "podman info" the emulated architectures will show, this
was used so you can grab the information from the podman engine.

Fixes containers#13014

Signed-off-by: Joshua Arrevillaga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants