I am trying to access a deb package on my host, for installation in my docker build.
My Dockerfile looks like this:
RUN mkdir /install_files
ADD /opt/jdk-14.0.2_linux-x64_bin.deb /install_files/
RUN dpkg -i /install_files/jdk-14.0.2_linux-x64_bin.deb
And my host has the file:
$ ls /opt
jdk-14.0.2_linux-x64_bin.deb
# other stuff
I run docker build
from a shell script, and the result is this:
Step 17/22 : ADD /opt/jdk-14.0.2_linux-x64_bin.deb /install_files/
ADD failed: stat /home/gauthier/.docker-images/tmp/docker-builder811924854/opt/jdk-14.0.2_linux-x64_bin.deb: no such file or directory
I read about ADD
here, and I don't see how I'm using it wrong. Somehow, docker
looks in a tmp directory instead of the host's /opt/
. It might be wrong or not, I don't know.
How do I use the deb package from my host, to build the docker image?