-
Notifications
You must be signed in to change notification settings - Fork 1.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
support multiple exporters for build #1555
Comments
hello @tonistiigi I am looking on this and ready to help. Can you orient me please: I don't understand why you moved the issue to thank you again |
@fahedouch The problem is that if you would remove this return in buildx it would just fail in the next lines because buildkit doesn't support this case yet. Eg. https://github.com/moby/buildkit/blob/master/client/solve.go#L119 and then the field currently used by API doesn't even take an array https://github.com/moby/buildkit/blob/master/client/solve.go#L204 . |
any updates on this? |
is there any workaround? in our case, what's happening is that when we wanted to push to another tag/output, |
Nothing invalidates the cache for me so its really quick to export, I've created another step where I split into two more containers, one for export and one for interactive docker to use. That's the workaround. Now in my docker file I have two extra lines like this: FROM scratch AS file_to_export
COPY --from=os_img /file/to/export / Then I just have the docker builds with the necessary outputs needed: # --output=type=docker -> interactive use, mostly to be able to use "docker run" command
# --output=type=registry -> a place where the image can be cached so that we can load it
# --output=type=local,dest=output -> save the entire docker image/file from docker to disk and of course I tag the images differently too, and I use os_img with the docker export and the new file_to_export as the local file output. |
@adminy |
run: build
# Interactive container
docker buildx build $(FLAGS) --target silly_name_run --tag some_tag --output=type=docker --cache-from=type=registry,ref=$(PREFIX):build .
docker run --privileged -p 8080:8080 -it some_tag /bin/bash
img: build
# Output container
docker buildx build $(FLAGS) --target silly_name_export -o type=local,dest=output --cache-from=type=registry,ref=$(PREFIX):build .
build: some other prequisites
docker buildx build $(FLAGS) --target silly_build_$@ --output=type=registry --tag $(PREFIX):$@ --cache-from=type=registry,ref=$(PREFIX):$@ --cache-to=type=registry,ref=$(PREFIX):$@,mode=max . |
Since build-push-action doesn't support outputing an image to multiple outputs we need to save it in a separate step. See: moby/buildkit#1555 Once multiple outputs are supported we can replace this step with `outputs` property configured in `Build Docker Build Image`: outputs: | type=image type=docker,dest=/tmp/go-build-env-image.tar
Eg. allow pushing and loading to local tarball with the same request.
moved from docker/buildx#316
The text was updated successfully, but these errors were encountered: