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

"Custom build outputs" support #9586

Open
tpict opened this issue Jun 22, 2022 · 8 comments
Open

"Custom build outputs" support #9586

tpict opened this issue Jun 22, 2022 · 8 comments

Comments

@tpict
Copy link

tpict commented Jun 22, 2022

Are there any plans to support Docker's custom build outputs, either via a flag to docker-compose build or in the Compose file? Thanks!

@ndeloof
Copy link
Contributor

ndeloof commented May 12, 2023

How would docker compose up handle this, if you configure build output to write image to a local tar file, to create a container for service after a successful build ?
At most, such an option could only be available for docker compose build. is this what you are asking for ?
Maybe docker compose build --output type=tar,dest=some_path could generate image files as some_path/.tar`?

@ndeloof
Copy link
Contributor

ndeloof commented Jun 1, 2023

created a draft PR to add support for custom build outputs, please give it a try and let me know if this covers your need
#10642

@Aarbel
Copy link

Aarbel commented Jun 14, 2023

It would be extremely useful

image

Docker outputs on docker-compose doesn't show all necessary informations.
In this cas, i absolutely don't know which container is "eca8ccf1c84e"

@ndeloof
Copy link
Contributor

ndeloof commented Jun 14, 2023

@Aarbel your comment is unrelated to custom build output, feel free to open a dedicated issue (and include docker inspect eca... for diagnostic

@ndeloof
Copy link
Contributor

ndeloof commented Apr 19, 2024

Closing as obsolete. Requested feature is unclear how this would benefit docker compose usage

@ndeloof ndeloof closed this as completed Apr 19, 2024
@Ryanf55
Copy link

Ryanf55 commented Apr 19, 2024

Here is my use case:

For Custom Build Output here, it is useful for me to take the build logs and test artifacts created during docker build and expose them back to the host so they can be uploaded into Gitlab as a CI artifact. Currently, I create these with docker build command. I would like to migrate everything to compose, but this lack of supports for outputs makes the migration impossible.

@ndeloof ndeloof reopened this Apr 19, 2024
@gegles
Copy link

gegles commented May 21, 2024

Hello, I was just directed to this and yes, we would really need this as well...
We leverage docker compose extensively for dev, test, build and prod... We especially use a complex multi stage build.

Having docker compose helps us encapsulating what would otherwise be pretty complex docker build or run commands..

One of the stage of the build is to to create official binaries (RPM/DEB packages). We can even build multiple archs (amd64, arm64, s390x and ppc64le) thanks to the platform field...

But, sadly, custom build outputs (--output arg) is not supported by docker compose and thus we end up with a pretty complicated build command:

docker buildx build --secret id=conan_password,env=CONAN_PASSWORD --secret id=conan_login_username,env=CONAN_LOGIN_USERNAME --ssh=default --target packages --output=build/linux --platform linux/amd64 --platform linux/arm64 .

Even though all those things are also defined in the compose.yaml.

Please add the output field to the compose spec. 🙏🏻 . Thanks!

@ndeloof
Copy link
Contributor

ndeloof commented May 21, 2024

@gegles use docker buildx bake so you don't need this long command line and can reuse declarations from your compose file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants