My Dockerfile have a script to run on ENTRYPOINT. The container is planned to run with a volume mount where my code resides, and it needs to run couple of commands once the container is up with volume mount.
But from errors I get while running container, I believe Docker volume mount happens after the ENTRYPOINT script.
I sure can run the commands with docker exec options once container is up. But that makes it more lines of running commands. Is there any work-around, even by using docker-compose?
Dockerfile :
FROM my-container
WORKDIR /my-mount-dir
ADD startup-script.sh /root/startup-script.sh
ENTRYPOINT ["/root/startup-script.sh"]
Docker Run :
docker run -itd -v /home/user/directory:/my-mount-dir build-container
Note : startup-script.sh includes commands supposed to run on the mounted directory files.