Merge pull request #2053 from ndeloof/proxy-config

set proxy env vars based on CLI config
This commit is contained in:
Ulysses Souza 2021-08-31 07:44:02 -07:00 committed by GitHub
commit 61338d3477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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),