set proxy env vars based on CLI config

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-08-31 14:04:31 +02:00
parent 52df801287
commit 007ec5afee
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 4 additions and 1 deletions

View File

@ -269,6 +269,9 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
return nil, nil, nil, err
}
proxyConfig := types.MappingWithEquals(s.configFile.ParseProxyConfig(s.apiClient.DaemonHost(), nil))
env := proxyConfig.OverrideBy(service.Environment)
containerConfig := container.Config{
Hostname: service.Hostname,
Domainname: service.DomainName,
@ -288,7 +291,7 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
MacAddress: service.MacAddress,
Labels: labels,
StopSignal: service.StopSignal,
Env: ToMobyEnv(service.Environment),
Env: ToMobyEnv(env),
Healthcheck: ToMobyHealthCheck(service.HealthCheck),
Volumes: volumeMounts,
StopTimeout: ToSeconds(service.StopGracePeriod),