-
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
Document that fig does not always rebuild images automatically #614
Comments
Auto-build is analogous to auto-pull (whose behaviour in turn mirrors |
@aanand I think the message shown when running |
Ah ok, thanks for the explanation. Yes the "(re)building" message is a bit confusing. |
+1 @aanand It wasn't clear to me that |
+1 I also had expected, that fig automatically rebuilds when my code changes ... maybe an auto-build switch in fig.yml could be a solution? |
This bit me today. +1 |
Same here, took me half an hour today to figure out that the image is not being rebuilt when I make changes to Dockerfile. I think default docker behaviour is rebuilding from the first changed line in a file so I was expecting this. |
@83tb that's not "default docker behaviour", it's what Docker does if you run It's clear that Fig's behaviour is confusing a lot of new users. I can see two obvious ways to alleviate this:
|
I meant default for I would vote for #2. |
I think I lean towards option 2, forcing people to make |
+1 documentation for 'fig up' also compounds the issue http://www.fig.sh/cli.html While technically correct, this was confusing. |
I would vote for options 2 also. |
+1 for option 1, to rebuild image at each fig up. Furthermore, I was wondering: why don't you change the flow, such that it is: Anyway to avoid all these changes, it is enough to run fig build just before fig up |
👍 rebuild image on each up. |
Correct dockerfile doesn't lead to slow rebuild. Even on my old slow MacBook Air it tooks less than a second. Otherwise I have to use "docker-compose build && docker-compose up" to not worry about it on each change. So, +1 "rebuild image on each up.". |
My opinion:
|
Would a parameter make sense? |
@udl No. Imagine:
So, in the end, the question — what is the purpose of this command, if it cannot "start and run your entire app" and need in any case use another command (or option) in addition? I think, "up" in any case is not "incremental" command — to speedup (if need) development, I will use restart/reload commands (docker-compose doesn't support completely this workflow yet, but it is another topic). |
@develar I personally would prefer re-building on every I think the confusion about how |
Sorry if this is naive, but is it possible to automatically rebuild if *.yml or Dockerfile were updated since last build? |
thought this woul be the default behaviour of compose 👍 |
This is technically fixed, https://docs.docker.com/compose/reference/up/ However, I think the language used is very confusing. Instead of talking about "picking up changes", it might be better to just say "By default, if a service's image and configuration have not changed, that service's containers will not be re-created." Can a core contributor either close this issue or +1 my suggestion and I will PR? |
In #2601 we added a warning any time We also add the |
We're always interested in PRs which improve the docs, so please don't hesitate to submit a PR to improve them. Thanks! |
Fig does not seem to rebuild the image it uses to create a container when the referenced "build:" Dockerfile or directory has changed. More documentation about how using "build:" differs from "docker build" would be good.
E.g., I have directories "foo" and "foo-single":
foo/Dockerfile
foo-single/Dockerfile
I changed foo/Dockerfile and rebuilt both images with "docker build -t foo ./foo" and "docker build -t foo-single ./foo-single" (though I guess that doesn't matter, fig only looks at the build directory?).
My fig.yml has this so I expected it to pick up the new foo-single, but it does not. I even tried deleting the container ("docker rm myproject_bar") thinking it would check for build changes, but it still used the outdated "myproject_bar" image .
I guess fig doesn't check if the Dockerfile or its directory contents have changed? I had to explicitly "docker rmi myproject_bar" in order to get the new "foo" changes.
The text was updated successfully, but these errors were encountered: