When I try to docker-compose up with one of my images missing, I get:
Service 'server' needs to be built, but --no-build was passed.
I understand from the documentation that this is indeed what the --no-build option does:
--no-build Don't build an image, even if it's missing
Why is this default behavior and how can my docker-compose up automatically trigger a docker-compose build beforehand?
This is monitored by issue 1679: "docker-compose up assumes --no-build"
The crux of the problem is:
if my image exists (because I ran
docker-compose buildbefore), but the referredDockefilechanges, up won't trigger an automatic rebuild?
It may be a misunderstanding, but I thought that up always rebuilds the image if the Dockerfile is out of sync with the image, unless--no-buildis passed.
aanand adds:
uponly checks that the image exists, not that it's up-to-date.
There's actually no way to check that.We've discussed alternative approaches, including always building and never building.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With