The AWS documentation indicates that the environment variables are passed in through the
docker run --env invocation. This leads me to believe that the answer to your question might be on the docker side.
I was looking for something similar and found this conversation, it may apply to your situation here: https://github.com/moby/moby/issues/15383#issuecomment-128748669
USER directive is not expected to have an impact on which environment variables are accessible from the docker side.
Are you doing anything with
As a general rule, the USER directive will not have any impact on your environment variables.
Environment variables in Linux are inherited by each process from its parent process. This happens automatically unless something specifically overrides this behavior.
Here are some things to check:
- Have you confirmed that the environment variables are visible to the root user?
- Are you (or the service you're starting) employing any special privilege dropping or security practices that might be intentionally filtering environment variables?
- Are you following the "One Process per Container" best practice for Docker containers? (If not, this can make it harder to troubleshoot this kind of problem.)
- In your Dockerfile, are you introducing any wrappers or startup commands that might be creating an overly-complex process tree? (This would increase the chances that some environment variables are being swallowed by a layer of indirection or security.)
If all else fails, run the container locally and inspect the process environments directly (on the host) by checking /proc/$PID/environ. You can see where the environment variables are getting stripped by looking in there.
how to put variable into a string as a prefix of function in Graphql?asked a month ago
Using S3 bucket as a file server for the publicasked 4 months ago
Access S3 as a Bind Mount from a Containerasked 6 months ago
how to save a file while running an etl job in a fargate task?asked 2 months ago
How to access environmental variables on a Fargate ECS Task as a non-root user?asked 13 days ago
Run shell script as EC2 user on Cloud formation User dataasked 5 months ago
Container cannot bind to port 80 running as non-root user on ECS FargateAccepted Answerasked 5 months ago
DataSync Agent -- What user does it run as?Accepted Answerasked 2 years ago
ECS Fargate Task Logs Empty When Using a Entrypoint Shell Scriptasked 5 months ago
JSON not working as a command in ECSasked a month ago