Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Securing/Encrypting the sensitive environment variables

I'm using an env file which contains sensitive information for docker creation.

But the thing is they are not secure. They can be easily viewed via docker inspect, and hence they are available to any user that can run docker commands.

I'm looking for a way in which I can secure these values from the outside users, without using docker swarm.

Is there a way to achieve this?

like image 929
Nobita Avatar asked Jan 20 '26 23:01

Nobita


1 Answers

For variables needed in built-time (image creation):

  • ARG: --build-arg

For env variables needed when container starts:

  • --env-file: It lets you nobody can see your variables doing history inspecting your cli command.
  • Use docker secrets: possible in swarm, docker enterprise. (docker swarm secrets)
like image 185
Alejandro Galera Avatar answered Jan 23 '26 16:01

Alejandro Galera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!