I am attempting to modify a Dockerfile
that includes code like this:
ARG FILE_SOURCE_DIR
ADD ${FILE_SOURCE_DIR}/check-md5.sh /download/
ADD ${FILE_SOURCE_DIR}/app /app/
ADD ${FILE_SOURCE_DIR}/R/JRI.jar /download/
ADD ${FILE_SOURCE_DIR}/R/JRIEngine.jar /download/
ADD ${FILE_SOURCE_DIR}/R/REngine.jar /download/
My build environment looks like this:
\downloads
\images
\kafka
Dockerfile
I would like to pass in FILE_SOURCE_DIR
as a relative path (per the documentation) but I can't get the syntax right - no matter what I try I get an error similar to:
ADD failed: stat /var/lib/docker/tmp/docker-builder187920988/downloads/check-md5.sh: no such file or directory
Sometimes I get this:
ADD failed: Forbidden path outside the build context: ../../downloads/check-md5.sh ()
I know that the path has to be relative to the context directory but as I said, nothing I try seems to work:
"../../downloads"
"..\..\downloads"
"C:\path\downloads\"
Is the Docker ADD command limited to things inside the context? If so, how does one include the same file in multiple contexts?