Merge pull request #2173 from maurobender/fix_one_shot_commands_executing_using_host_environment
Fix one-shot commands for a specific container being executed using host environment variables
This commit is contained in:
commit
00e7167174
@ -122,7 +122,7 @@ public function runCommand()
|
||||
if ($server->isForceDisabled()) {
|
||||
throw new \RuntimeException('Server is disabled.');
|
||||
}
|
||||
$cmd = 'sh -c "if [ -f ~/.profile ]; then . ~/.profile; fi; ' . str_replace('"', '\"', $this->command) . '"';
|
||||
$cmd = "sh -c 'if [ -f ~/.profile ]; then . ~/.profile; fi; " . str_replace("'", "'\''", $this->command) . "'";
|
||||
if (!empty($this->workDir)) {
|
||||
$exec = "docker exec -w {$this->workDir} {$container_name} {$cmd}";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user