-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Proposal: Don't build images #1455
Comments
I like the UNIX thinking behind this proposal, but I'm having a hard time envisioning it as anything other than a burden without some examples of how it would work.
|
I agree that supporting image names and tags from environment variables would have to be supported before we were to do anything like this. Compose does accept image ids (it was broken for a release, but I think the fix is in 1.3.0). I don't think that naming an image is a huge burden, but with environment variable support, using image ids should work as well. |
It's definitely true that building images is complicated, that Compose's primary job is orchestration and not building, and that the Docker image is the natural place to draw that line. Swarm has already drawn that line by not supporting building at all, and down the line it's likely that building will be moved out of even the Docker daemon, to become a client-side process which just performs create/start/commit calls against the API. Still - alongside everything else, Compose remains a tool for development environments, and having a simplistic In any case, when it comes to the multitude of use cases you've linked to where Compose falls short, we might do well to recommend tools or approaches in the documentation (I suspect a Makefile would serve a lot of them). |
I kind of don't mind having |
I'm still on the fence on this one. On one hand, it makes sense to make docker-compose only "orchestrate". On the other hand, having a single configuration file that defines which Dockerfiles have to be built for each service and which context to use for them, is really convenient. Basically, it allows one to describe the whole "stack" in a single file, and just looking at the file describes what the project looks like. |
I guess it is nice and convenient to do (in development) Problem is from a philosophical point of view; I don't really find myself doing this that often and could live with splitting this "workflow" out to a searpate "integration" and "testing" phase where I can build up the whole "stack"; but the parts are built individually. |
Perhaps docker-compose should have some "hooks" that can trigger external tooling. (Really thinking out loud here) |
TBQH though; I am kind of torn over this. Whilst I don't use the build feature of docker-compose myself that much it can still be nonetheless useful in some situations and for others :) |
i like the idea of dropping the build-, and consequently the pull-command. in order to make these a convenience in every situation would require a blow-up of the configuration options.
word. just let users place an executable |
Environment variables, please! :)
|
that's what i mean. scripts can access environment and write env-files or manipulate a project-configuration. |
I use build and Dockerfiles which are FROM the public registry to handle customizing package sources and proxy stuffs, it is useful. |
From its origin, fig was a tool for development environnement, and still today it's the only (and the best !) CLI tool for that purpose. Because I uses docker-compose intensively for development, I don't agree with @dnephin that compose is a only tool for composing services. In my dreams, only Building an image is one of the basic steps to learn Docker |
I essentially agree with @josephpage on this: If a tool like |
I entirely rely on "docker build" finding out what needs to be built from my docker-compose.yml file, so if that was removed that would greatly disrupt my workflow. |
Another argument for removing Have a config where 2 fields apply to one operation, and the other 20+ fields apply to a completely different operation isn't very intuitive. |
Again I would highly suggest just removing the implicit build triggered by Docker compose is right now a nice tool to manage all around my docker image groups which pretty much covers everything needed. While the build support is primitive, it still saves time and makes it easier to manage the whole thing including the necessary build step in one simple tool. One important point why docker-compose should cover everything and not just the running non-build functionality is that the docker-compose.yml contains information how the images will be named as well. If you remove basic functionality from docker compose to limit its scope, you will force people to parse docker-compose.yml manually with other tools to get that information, or force people to have yet another configuration file lying around which holds it instead. That seems like a nonsensical idea to me. |
👍 to @Jonast 's idea. |
👎 |
I think you will see a hard fork of this project if this happens as it completely destroys the use of it in development. |
I think it's clear that until we have another tool that would replace the build configuration we won't be removing |
While that makes a lot of sense, this isn't much of a feature request but more a suggestion for a simple trivial change for a user experience problem. Lack of features is very reasonable if something isn't your main area, but that doesn't mean the ones that are present couldn't be optimized a bit when the user experience is too confusing. However, as I stated above I think removing (unless this was already solved by some other change, e.g. building with every |
An even more aggressive step from #693, compose could entirely remove the ability to build images.
Rational: If compose is a tool for composing services, the process of building images for those services is distinct from the concerns of running services.
The docker images already provides a great interface for separating these concerns. The existing
compose
support for building an image is pretty primitive, and could be easily replaced.There are many different build scenarios, each of which could be handled by a separate tool:
build from urls (Add support for pointing to tarball contexts in the 'build' parameter. #1209, Support build urls #1369)pulling base images (docker build --pull #726)--build-arg
command line flag (Add support for --build-args #2111 (comment))Some of these problems are already solved by existing build tools:
(There are probably other tools that I'm not aware of at this time.)
Backwards Compatibility
In order to preserve some form of backwards compatibility we could:
build
tag exists, and continue to build imagesbuild
anddockerfile
keysbuild
anddockerfile
fields, and require a separate config for building images. Initially that config might be in a similar format, but likely it would evolve to support many of the scenarios described aboveThe text was updated successfully, but these errors were encountered: