Volume mount not working

I am trying to copy a folder (Which has a number of sub folders and files in it) to the docker image.

Tried with COPY command in Dockerfile. But it didn’t work saying the file doesn’t exist.

Tried to mount the volume during docker run. Its just creating the folder name i gave in the docker container. No subfolders/files are copied from source to destination.

Any pointers on what would be the issue here?

You wrote “volumn” twice (in the title and in the content). It would be volume. In your case it is probbaly a bind mount. Mounting a folder from the host to the container. If the host folder is empty, the folder in the container will be empty.

Unless you can share someting that we can actually work with, like an error message, a Dockerfile and your folder structure on the host, and posisbly your compose file or how you start the container (if the container is where you notice the files are not found) that’s all I can guess.

I am not getting any error message. Command used for docker run is

docker run -v /usr/local/AHFormatterV74:/usr/local/AHFormatterV74 --rm -p 8080:8080 quickstart-mp:latest

source directory:

cd /usr/local/AHFormatterV74

ls
EULA.txt bin etc include license
ReadMe.txt docs fonts lib run.sh

Target directory inside docker container:

[root@eb6c65f36f79 ]# cd /usr/local/AHFormatterV74/
[root@eb6c65f36f79 AHFormatterV74]# ls
bin
[root@eb6c65f36f79 AHFormatterV74]# pwd
/usr/local/AHFormatterV74
[root@eb6c65f36f79 AHFormatterV74]#

Not modifying anything related to this in Dockerfile. Please review.

How did you install Docker? Default (using root) or root-less?

What user is the Docker image using? Maybe a dedicated user-id, which is not root/0?

Then what was this?

Note that if you use Docker Desktop, you can’t mount /usr/local and it will create a new folder in the virtual machine of Docker Desktop. I’m not why the COPY command didn’t work, but that is why I asked for an exact error message if there was one.

Even if we can help you fix this, I don’t think that copying or mounting binaries and libraries from the host is a good idea. Depending on the operating system and distribution the required libraries and binaries could be different and incompatible.