Docker ENTRYPOINT to run after volume mount Docker ENTRYPOINT to run after volume mount linux linux

Docker ENTRYPOINT to run after volume mount


I'm not sure if this is the solution you want but I've been using this run command which uses cat command to supply my script.sh to the container:

docker run -it --name=some_name --rm \  -v "host/path:/path/inside/container" \  image_name \  /bin/bash  -c "$(cat ./script.sh)"

In this case the script runs after the mount is complete. I am sure of this as I've used the files from the mounted volumes in the script.


I have seen that in some of my scripts and it looks like file system cache problem to me... I use the following hack in my docker file and it works like a charm:

ENTRYPOINT ls /my-mount-dir && /root/startup-script.sh

But then you cannot use the list form for the ENTRYPOINT