fix: ensure compose projects are spawned from the /tmp directory
A recent update to compose executes a stat call in the current working directory, which may have incorrect permissions for execution once the user is changed to the dokku user. This change forces all compose commands to execute in the /tmp directory by using a helper function to execute compose up/down. Closes #7705
This commit is contained in:
@@ -50,6 +50,9 @@ type ExecCommandInput struct {
|
||||
|
||||
// Sudo runs the command with sudo -n -u root
|
||||
Sudo bool
|
||||
|
||||
// WorkingDirectory is the working directory to run the command in
|
||||
WorkingDirectory string
|
||||
}
|
||||
|
||||
// ExecCommandResponse is the response for the ExecCommand function
|
||||
@@ -134,6 +137,10 @@ func CallExecCommandWithContext(ctx context.Context, input ExecCommandInput) (Ex
|
||||
DisableStdioBuffer: input.DisableStdioBuffer,
|
||||
}
|
||||
|
||||
if input.WorkingDirectory != "" {
|
||||
cmd.Cwd = input.WorkingDirectory
|
||||
}
|
||||
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
argsSt := ""
|
||||
if len(cmd.Args) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user