I have below Docker cmd:
docker run -it -p 27017:27017 -v /Users/john/db/:/data/db --name k1 mongo
When I run above command, I want to precheck whether "/Users/john/db/" folder path already exists or not. If it does not exist, then I want to throw a custom exit code and stop the container from starting.
How to do this?
If I write an entrypoint script which will run before container starts, how would I access -v arguments? means this "/Users/john/db/" in entrypoint bash/python script?