Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions pkg/compose/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,15 @@ func (s *composeService) setupPluginCommand(ctx context.Context, project *types.
args = append(args, service.Name)

cmd := exec.CommandContext(ctx, path, args...)
// Remove DOCKER_CLI_PLUGIN... variable so plugin can detect it run standalone
cmd.Env = filter(os.Environ(), manager.ReexecEnvvar)
// exec provider command with same environment Compose is running
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
server, err := socket.NewPluginServer(nil)
Expand Down