set provider environment
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
ed81185c5c
commit
07e7619f4e
@ -168,8 +168,15 @@ func (s *composeService) setupPluginCommand(ctx context.Context, project *types.
|
|||||||
args = append(args, service.Name)
|
args = append(args, service.Name)
|
||||||
|
|
||||||
cmd := exec.CommandContext(ctx, path, args...)
|
cmd := exec.CommandContext(ctx, path, args...)
|
||||||
// Remove DOCKER_CLI_PLUGIN... variable so plugin can detect it run standalone
|
// exec provider command with same environment Compose is running
|
||||||
cmd.Env = filter(os.Environ(), manager.ReexecEnvvar)
|
env := types.NewMapping(os.Environ())
|
||||||
|
// but remove DOCKER_CLI_PLUGIN... variable so plugin can detect it run standalone
|
||||||
|
delete(env, manager.ReexecEnvvar)
|
||||||
|
// and add the explicit environment variables set for service
|
||||||
|
for key, val := range service.Environment.RemoveEmpty().ToMapping() {
|
||||||
|
env[key] = val
|
||||||
|
}
|
||||||
|
cmd.Env = env.Values()
|
||||||
|
|
||||||
// Use docker/cli mechanism to propagate termination signal to child process
|
// Use docker/cli mechanism to propagate termination signal to child process
|
||||||
server, err := socket.NewPluginServer(nil)
|
server, err := socket.NewPluginServer(nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user