Skip to content

Commit

Permalink
Add PHP 7.4 image to the Dockerfile generator (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke authored Nov 17, 2020
1 parent 5052642 commit 63f1ad6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/DockerFileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ final class DockerFileGenerator
Dockerfile;

private const PHP_DOCKER_IMAGES = [
'7.4.0' => '7.4-cli-alpine',
'7.3.0' => '7.3-cli-alpine',
'7.2.0' => '7.2-cli-alpine',
'7.1.0' => '7.1-cli-alpine',
Expand Down
4 changes: 2 additions & 2 deletions tests/DockerFileGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function test_throws_an_error_if_cannot_find_a_suitable_PHP_image(): void
;
} catch (UnexpectedValueException $exception) {
$this->assertSame(
'Could not find a suitable Docker base image for the PHP constraint(s) "^5.3". Images available: "7.3-cli-alpine", "7.2-cli-alpine", "7.1-cli-alpine", "7-cli-alpine"',
'Could not find a suitable Docker base image for the PHP constraint(s) "^5.3". Images available: "7.4-cli-alpine", "7.3-cli-alpine", "7.2-cli-alpine", "7.1-cli-alpine", "7-cli-alpine"',
$exception->getMessage()
);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ public function provideGeneratorRequirements(): Generator
],
'box.phar',
<<<'Dockerfile'
FROM php:7.3-cli-alpine
FROM php:7.4-cli-alpine
RUN $(php -r '$extensionInstalled = array_map("strtolower", \get_loaded_extensions(false));$requiredExtensions = ["zlib", "phar", "openssl", "pcre", "tokenizer"];$extensionsToInstall = array_diff($requiredExtensions, $extensionInstalled);if ([] !== $extensionsToInstall) {echo \sprintf("docker-php-ext-install %s", implode(" ", $extensionsToInstall));}echo "echo \"No extensions\"";')
Expand Down

0 comments on commit 63f1ad6

Please sign in to comment.