With this way, none of docker inspect, docker exec [container_id] envor bash into docker container and run env will see these environment variables, ie. what we injected with bootstrap script are opaque.

So the question: is there anything else we should consider with this solution? any obvious glitches?

We are pretty new to docker world, so this behaviour, about making environment variables injected by shell script are not visible since after, is there any document explaining why? we haven’t found a good doc but just found it’s working in this way

However, I don’t think you can complete hide the environment variables from someone who has permissions to inspect process envs. It seems to me that if you find out the process id of the application process (inside the container or from the host) you should be able to find its environment in /proc. Won’t show up as docker env, but it’s still in there somewhere.
Also, any such person can probably connect to your Vault directly anyway.

Meaning, yes, this will reliably not make the environment of child processes show up in the container environment, but it does not really hide it from anyone (who can already access your host machine and control docker).

Still, congrats on this setup. Much better than having credentials built into images.

The values of environment variables are local, which means they are
specific to the running process in or for which they were set. This
means that if we open two terminal windows (which means we have two
separate bash processes running), and change a value of an environment
variable in one of the windows, that change will not be seen by the
shell in the other window or any other program currently on the
desktop.