My approach seems to work, but probably naively. Tell me why this is wrong.
ARGs installed during docker build are displayed by the history subcommand, so they are not needed there. However, when the container starts, the environment variables specified in the start command are available to the container, but are not part of the image.
So, in the Dockerfile, configure a setting that does not include sensitive data. Install CMD something like /root/finish.sh . In the run command, use environment variables to send sensitive data to the container. finish.sh uses variables essentially to complete build tasks.
To simplify the management of sensitive data, put it in a file downloaded by docker using the --env-file switch. Of course, keep the file secret. .gitignore etc.
For me, finish.sh runs the Python program. It checks to see if it is running earlier, then completes the configuration (for example, copies the database name to Django settings.py ).
Kieran Mathieson Jul 28 '17 at 20:37 2017-07-28 20:37
source share