Probably either via a third party service (such as AWS secrets manager), or mounted as files scoped to the user your process is running as (which is not root, right? :) ).
Typically your host will have a service specifically for secrets. For example: https://docs.github.com/en/free-pro-team@latest/rest/referen...
Re:Dockerfile Security Best Practices
by CGamesPlay on Wednesday October 14, 2020 @08:35PM
(#24783455)
Two kinds of secrets: build-time (I need an API key to access a download needed to set up the container) and run-time (I need an API key to talk to the database). The post argues against using ENV for build-time secrets, but it's still recommended for run-time secrets. Sibling comments address alternatives for getting build-time secrets in.
Re:Dockerfile Security Best Practices
by keikun17 on Wednesday October 14, 2020 @02:06PM
(#24779599)
using buildkit https://pythonspeed.com/articles/docker-build-secrets/
What's the best way to handle this?