By using “AS build”, it appears if you are doing a multi-stage build. The /src will not be created in the image of the second stage. That is the very purpose of muti-stage builds - you can throw into the build stage file system whatever mess you like, and in the second stage pick up the nice, tidy build artifacts and copy them into a clean image, leaving the build debris behind. If that is exactly as you intended - fine. If you expect the /src directory to appear even in the final image, you must create it in the second stage as well.