-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dockerfile in .dockerignore is not respected, leading to unnecessary full rebuilds #9407
Comments
Note that other files in |
I just noticed another difference between
Diff with getting-started example:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
When I:
Dockerfile
in.dockerignore
COPY . .
in myDockerfile
I expect the Dockerfile to NOT be copied into the image. This is indeed the behaviour when doing
docker build .
Actual behavior
skaffold build
DOES copy theDockerfile
into the image, causing a lot of unnecessary build steps to be done every time anything (even just whitespace) changes in theDockerfile
Information
COPY
commands replaced with a singleCOPY . .
:Steps to reproduce the behavior
COPY
commands in theDockerfile
with a singleCOPY . .
.dockerignore
file containing just the lineDockerfile
skaffold build
Dockerfile
, eg. adding an empty lineskaffold build
now needs to recompile the binary rather than use the cached versionNote that
docker build
does NOT show this behaviour: it will correctly NOT copy the Dockerfile into the image, so it can reuse the cached image layers.I am aware that
COPY . .
might not be the best practice, and changing theDockerfile
should be an infrequent occurence so this does not have any great impact. However, I do think it's worth to keep the behaviour ofskaffold build
as much the same asdocker build .
as possible.The text was updated successfully, but these errors were encountered: