I am working to containerize a program. The program requires a configuration file and directories for its operation, which are passed as command line arguments, e.g. something like this:
$ myprog -c /path/to/config.conf -i /directory/with/input_files -o /directory/with/output_files
I know that I will need mount docker volumes to the containerized version of this program so that it can access the config file and directories. But, I would like to maintain the command-line interface unchanged (as far as possible) to hide the complexity of using docker volumes, etc. from users. How do I do this?
Will I need to create a wrapper script that maps the values of the command-line arguments (-c
, -i
, -o
) to mount the corresponding paths as docker volumes? If so, what is the best practice for packaging it (i.e. to distribute the script with the container) and making this work cross-platform (i.e. so that it runs on Windows, MacOS, Linux)?