Fly secrets available to all users or just root?

I’m having an issue with environment variables setup using secrets.

I’m deploying a Ghost blog image on user “node” as per the Dockerfile instructions, using secrets for environment variables, which is working fine since Dockerfile seems to run on user “root”.

However, I still need these environment variables to be available for user “node”, since that’s the user I run ghost on in runtime.

The problem is when I login to the node user via su - node and then try to echo $DATABASE_URL for example or any of the other environment variables, none seems to be available.

Has anyone else experienced this?

How do I make secrets environment variables available to other users?

Try su node (i.e., without the minus). See su(1) - Linux manual page for more details.

1 Like

Wow that actually works, and I feel like a total Linux newbie! :sweat_smile: Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.