mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Make sure that image is correctly pulled before continuing
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
03aa7a1ce1
commit
10a8f5b099
1 changed files with 9 additions and 3 deletions
|
|
@ -579,9 +579,15 @@ class DockerActionManager
|
||||||
|
|
||||||
public function PullContainer(Container $container) : void
|
public function PullContainer(Container $container) : void
|
||||||
{
|
{
|
||||||
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', urlencode($this->BuildImageName($container))));
|
$imageName = urlencode($this->BuildImageName($container));
|
||||||
// do not catch any exception so that it always throws and logs the error
|
$url = $this->BuildApiUrl(sprintf('images/create?fromImage=%s', $imageName));
|
||||||
$this->guzzleClient->post($url);
|
try {
|
||||||
|
$this->guzzleClient->post($url);
|
||||||
|
$imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName));
|
||||||
|
$this->guzzleClient->get($imageUrl)->getBody()->getContents();
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
throw new \Exception("Could not pull image " . $imageName . ". Please run 'sudo docker exec -it nextcloud-aio-mastercontainer docker pull " . $imageName . "' in order to find out why it failed.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isContainerUpdateAvailable(string $id) : string
|
private function isContainerUpdateAvailable(string $id) : string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue