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

Investigate if it's feasible to use local Docker or tar base image when building multi-platform images #2744

Open
chanseokoh opened this issue Sep 3, 2020 · 7 comments

Comments

@chanseokoh
Copy link
Member

No description provided.

@chanseokoh
Copy link
Member Author

chanseokoh commented Sep 23, 2020

About local Docker daemon images:

Note it is possible to pull an image to a Docker daemon even if the image platform doesn't match the platform running the daemon. (Of course, you can't run an image that doesn't match the machine platform.)

However, I doubted a local Docker daemon could host something like a manifest list. Tried buildx by following the doc to build multi-arch images but without pushing to a registry (i.e., without --push). As I expected, it shows a warning "no output specified".

$ docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 .
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load 
[+] Building 24.0s (9/9) FINISHED                                                                                                                                                                                 
 => [internal] booting buildkit                                                                                                                                                                             16.7s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                          15.5s
 => => creating container buildx_buildkit_mybuilder0                                                                                                                                                         1.2s
...

It's not feasible to use a base image from a Docker daemon when configuring multiple <platform>s at the moment. Potentially we could change our <from><image> config so that the user can configure multiple local Docker images with different architectures. However, I am not sure if this is worth considering. For now, I think we can just fail when given multiple platforms.

@chanseokoh
Copy link
Member Author

About local tar images:

Haven't looked into it, but I speculate that a tar image (either OCI or Docker) can easily contain multiple images. Worth taking a look.

@chanseokoh
Copy link
Member Author

But for now, I think these are a low priority and we can just fail when attempting to use a local base image with multiple platforms configured. Should be done before we can enable multi-platform image building.

@tom-haines
Copy link

added some local tar buildx image info on issue #2751 if relevant

@chanseokoh
Copy link
Member Author

@tom-haines thanks for the info!

@SgtSilvio
Copy link

SgtSilvio commented Jun 19, 2022

Using an OCI image tarball or even directory as a base image would make a lot of sense. Related: #2173

@hypnoce
Copy link

hypnoce commented Sep 20, 2022

It would also be of great help to output the built image into an oci directory structure instead of an oci tar, amending any existing index.

@chanseokoh chanseokoh removed their assignment Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants