DEV Community

Discussion on: Use Docker with Proxy Servers Tutorial

 
mcastellin profile image
Manuel Castellin

Mmm let me see.. did you have a look at the EnvironmentFile directive for systemd units?
I remember I did something like this to configure Samba persistent mounts while having passwords in a file with read-access only for the root user.

You could extract Docker proxy settings variables in a file such as /etc/docker/docker-proxy.env and then use the following directive in your unit file:

EnvironmentFile=/etc/docker/docker-proxy.env
Enter fullscreen mode Exit fullscreen mode

This article might also help you unix.stackexchange.com/questions/4...

Remember to lock down your environment file afterwards with chmod 400 /etc/docker/docker-proxy.env

I don't have an environment to test this out at the moment, let me know if this works!