gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
561 stars 102 forks source link

Image is none when --load is used #506

Open bianchi2 opened 11 months ago

bianchi2 commented 11 months ago

I am building a multi arch image like this:

image = self.docker_on_whales.build(context_path='.',
                                    build_args=buildargs,
                                    platforms=["linux/amd64"],
                                    load=True,
                                    attest='{"type": "sbom", "generator": "docker/scout-sbom-indexer:d3f9c2d"}')

The output is like this:

=> exporting to docker image format                                                                                                                                                                                                                                    19.3s
 => => exporting layers                                                                                                                                                                                                                                                  8.1s
 => => exporting manifest sha256:dcbf95f7a48516f3c6b805f7dcc07050538ae552a7b03048eceff541afe4408b                                                                                                                                                                        0.0s
 => => exporting config sha256:19ff252126cf0ab939a8434d0fc70f7f288aaef14d8d60c1ee4beb75d4985c32                                                                                                                                                                          0.0s
 => => sending tarball                                                                                                                                                                                                                                                  11.1s
 => importing to docker                                                                                                                                                                                                                                                  6.0s

However, the image is None:

Traceback (most recent call last):
    print(image.id)
AttributeError: 'NoneType' object has no attribute 'id'

This happens only if I use docker-container buildx builder.