Nikhil Vyas

Developer, Gamer. Python, C++, Rimworld

[Short] Dockerfile - COPY: no such file or directory

27 Feb 2019 » technology, others

Issue

Getting the error COPY: no such file or directory when you run a docker build for a Dockerfile with a COPY command like this - COPY /Users/nikhil/somefile.jar /somefolderonimage/

Fix

Docker doesn’t know about any file except the ones in $(pwd). It just denies its existence because of some weird design decision. Copy the files to be bundled with the image into the current working directory(Where you’re running the docker build from). And then use something like this - COPY somefile.jar /somefolderonimage/