Hello Guys I need help with the pass service token doppler in my docker file, I use command docker build --build-arg "DOPPLER_TOKEN=$DOPPLER_TOKEN" . In my github action but after push image to aws my app is not running I received error message: Doppler Error: you must provide a token
Your solution is really close! Instead of DOPPLER_TOKEN being a build ARG, Iād change this to an environment variable that should be supplied as part of your deployment process to AWS.
A common workflow with our customers is storing the service token value in a GitHub Secret, then a cloud-init (user data) script embeds that value as a DOPPLER_TOKEN environment variable that is then passed to the container to be run.
Something like:
export DOPPLER_TOKEN="${{ secrets.DOPPLER_TOKEN }}"
docker run -d -e DOPPLER_TOKEN=$DOPPLER_TOKEN your-app
Just be aware that embedding the service token in the image has the following implications:
Anyone that can pull the image can access the secrets linked to the service token
The image is now config specific as the secrets are tied to the image build
If this image is only for a single environment and you absolutely trust everyone that will ever have access to the image, then this is ok, but my recommendation would be to only supply the DOPPLER_TOKEN environment variable when running the container and not at build time.