Skip to content

Commit

Permalink
Correctly determine paths when building images
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainweb committed Jun 25, 2020
1 parent c274fd9 commit 682565f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DbDockerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ protected function guessSource(): string
protected function buildImage(string $imageId, string $sqlFile): void
{
$tempDir = realpath(sys_get_temp_dir());
$tempPath = sprintf('%s%s%s', $tempDir, DIRECTORY_SEPARATOR, sha1(uniqid()));
$assetPath = __DIR__ . '/assets/dockerize-db/';
$tempPath = sprintf('%s%s%s', $tempDir, DIRECTORY_SEPARATOR, sha1(uniqid())) . '/';
$assetPath = realpath(__DIR__ . '/../assets/dockerize-db') . '/';

copy($assetPath . 'Dockerfile', $tempPath . 'Dockerfile');
mkdir($tempPath);
mkdir($tempPath . 'dumps');
copy($assetPath . 'Dockerfile', $tempPath . 'Dockerfile');
copy($sqlFile, $tempPath . "/dumps/db.sql");
copy($assetPath . "zzzz-truncate-caches.sql", $tempPath . "zzzz-truncate-caches.sql");

Expand Down

0 comments on commit 682565f

Please sign in to comment.