Open fhemberger opened 5 years ago
Have you checked whether /app/out
contains the files you're looking for when you build only the build-env image?
We just encountered this issue in one of our builds. Typical builder/app multi-stage build based on node:alpine
where only node_modules
wasn't getting copied over into the final stage. We fixed the issue by ensuring we were setting a WORKDIR in the builder stage (previously nothing was set, leading to things being done in /
, the default workdir) and building things in a subdir created in the Dockerfile during the builder stage.
@fhemberger try to remove out
from .dockerignore
it worked for me :)
I believe that this should be a P1, as it definitely meets the criteria, "Basic need feature compatibility with docker build. we should be working on this next." (this is a pretty serious problem with docker build
compatibility for people using multi-stage builds).
Thanks to the tip from @malmuzaini, I was able to fix my issue by updating my .dockerignore
I'm trying to build an image in GitLab CI using the latest
debug
tag of kaniko (should be commit 9f65174cb8391e01b4fbeda178d0e9b63dcabd75 and gcr.io/kaniko-project/executor@sha256: 0445151f95a2bffc69d629683290a945c7309ac96c2f4cbd487aae2e5b9021e9).I'm modifying both the official Microsoft .Net SDK and Runtime image and store them in a private registry as base images.
Using a multistage build off these two images, the application directory is empty at the end of the process.
Custom .Net SDK image:
Custom .Net Runtime image:
Multistage build file for application:
The build process is passing:
However, the second last line makes me wonder:
And indeed, if I run the resulting container,
/app/
is empty. Running the exact same Dockerfiles with docker (18.09.1) works for me.