Is it possible to inherit any environment variables from host in swarm mode?

Hello,

Confused how can I use docker stack deploy with environment variables which shall be pulled from whatever host container will be running on. Example is below

services:
   webredirect:
      image: host.com/webredirect:latest
      environment: 
        - COMPUTERNAME

I want when container is started to inherit environment variable from host which is called Computername
It does not work since when you use docker stack deploy environment variable from whatever place docker CLI was running is embedded instead.

1 Like