Dockerfile: The above docker build fails with the error: target folder does not exist The below dockerfile works perfectly: Just changing CMD to RUN fixed the issue. Why is this happening? I thought in the intermittent container, the cmd would execute which should make both the commands equivalent right? Answer In a multistage build, you may copy files from a