@@ -37,8 +37,8 @@ func (wrapper *PluginWrapper) Deploy(ctx context.Context, filePaths []string, op
37
37
output , err := wrapper .command (newUpCommand (filePaths , upOptions {
38
38
forceRecreate : options .ForceRecreate ,
39
39
abortOnContainerExit : options .AbortOnContainerExit ,
40
- }), options .Options ,
41
- )
40
+ }), options .Options )
41
+
42
42
if len (output ) != 0 {
43
43
if err != nil {
44
44
return err
@@ -118,11 +118,22 @@ func (wrapper *PluginWrapper) command(command composeCommand, options libstack.O
118
118
cmd := exec .Command (program , args ... )
119
119
cmd .Dir = options .WorkingDir
120
120
121
- if wrapper .configPath != "" {
121
+ if wrapper .configPath != "" || len ( options . Env ) > 0 {
122
122
cmd .Env = os .Environ ()
123
+ }
124
+
125
+ if wrapper .configPath != "" {
123
126
cmd .Env = append (cmd .Env , "DOCKER_CONFIG=" + wrapper .configPath )
124
127
}
125
128
129
+ cmd .Env = append (cmd .Env , options .Env ... )
130
+
131
+ log .Debug ().
132
+ Str ("command" , program ).
133
+ Strs ("args" , args ).
134
+ Interface ("env" , cmd .Env ).
135
+ Msg ("run command" )
136
+
126
137
cmd .Stderr = & stderr
127
138
128
139
output , err := cmd .Output ()
@@ -159,7 +170,7 @@ func newCommand(command []string, filePaths []string) composeCommand {
159
170
160
171
type upOptions struct {
161
172
forceRecreate bool
162
- abortOnContainerExit bool ``
173
+ abortOnContainerExit bool
163
174
}
164
175
165
176
func newUpCommand (filePaths []string , options upOptions ) composeCommand {
0 commit comments