Quantcast
Channel: Active questions tagged containers - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 164

What is best practice for passing files and directories as command line arguments to a containerized program?

$
0
0

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)?


Viewing all articles
Browse latest Browse all 164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>