Answer the question
In order to leave comments, you need to log in
How to correctly copy files from "/" to docker image?
OS Mac
I need to move my machine's local files that are in the "/etc/scrt/ActivationCodes/AutorizationPswrd" directory to the docker image in the same directory.
In the Dockerfile I write:
FROM alpine: 3.9
RUN cd /etc
RUN mkdir scrt
RUN cd scrt
RUN mkdir ActivationCodes
RUN cd ActivationCodes
ADD /etc/scrt/ActivationCodes/AutorizationPswrd (from where locally) /etc/scrt/ActivationCodes/AutorizationPswrd (where to image)
Error when starting container: Step 7/17 : COPY /etc/scrt/ActivationCodes/AutorizationPswrd /etc/scrt/ActivationCodes/AutorizationPswrd
COPY failed: stat /var/lib/docker/tmp/docker-builder127783884/etc/scrt/ActivationCodes/ AuthorizationPswrd: no such file or directory
If I move the file from the /etc/scrt/ActivationCodes/AutorizationPswrd directory to the project folder and write
"COPY AutorizationPswrd /etc/scrt/ActivationCodes/AutorizationPswrd", the container starts without errors.
How can I access the /etc/scrt/ActivationCodes/AutorizationPswrd directory on my machine via root? I suspect that the error is due to the inability to access the root "/" of my machine, or the local path /etc/scrt/ActivationCodes/AutorizationPswrd is not recognized correctly.
Answer the question
In order to leave comments, you need to log in
I suspect that the error occurs due to the inability to access the root "/" of my machine
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question