How to bring credentials into a Docker container during build : <p>I'm wondering whether there are best practices on how to inject credentials into a Docker container during a <code>docker build</code>.
In my Dockerfile I need to fetch resources webservers which require basic authentication and I'm thinking about a proper way on how to bring the credentials into the container without hardcoding them.</p>

<p>What about a .netrc file and using it with <code>curl --netrc ...</code>? But what about security? I do no like the idea of having credentials being saved in a source repository together with my Dockerfile.</p>

<p>Is there for example any way to inject credentials using parameters or environment variables?</p>

<p>Any ideas?</p>
