Open tpict opened 2 years ago
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/
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 https://github.com/docker/compose/pull/10642
It would be extremely useful
Docker outputs on docker-compose doesn't show all necessary informations. In this cas, i absolutely don't know which container is "eca8ccf1c84e"
@Aarbel your comment is unrelated to custom build output, feel free to open a dedicated issue (and include docker inspect eca...
for diagnostic
Closing as obsolete. Requested feature is unclear how this would benefit docker compose usage
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.
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!
@gegles use docker buildx bake
so you don't need this long command line and can reuse declarations from your compose file
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!