diff --git a/README.md b/README.md index 80dd849..e02d6fc 100644 --- a/README.md +++ b/README.md @@ -86,93 +86,143 @@ Supported versions and flavours #### Community Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.8 | πŸŒ…οΈ discontinued | ❌ | ❌ | ❌ | ❌️ | ❌ | -| ^1.10 | πŸŒ…οΈ discontinued | ❌ | ❌ | ❌ | ❌️ | ❌ | -| ^2.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.8 | πŸŒ…οΈ | ❌ | ❌ | ❌ | ❌️ | ❌ | +| ^1.10 | πŸŒ…οΈ | ❌ | ❌ | ❌ | ❌️ | ❌ | +| ^2.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | #### Enterprise Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.12 | πŸŒ…οΈ discontinued | ❌ | ❌ | ❌ | ❌️ | ❌ | -| ^2.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.12 | πŸŒ…οΈ | ❌ | ❌ | ❌ | ❌️ | ❌ | +| ^2.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | ### OroCRM #### Community Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^2.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^2.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | #### Enterprise Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^2.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^2.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | ### OroCommerce #### Community Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | #### Enterprise Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^3.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^3.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^4.1 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | ### Marello #### Community Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.5 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^1.6 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^2.0 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^2.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^2.2 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^3.0 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.5 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^1.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^2.0 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^2.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^2.2 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^3.0 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | #### Enterprise Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.2 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^1.3 | πŸŒ…οΈ discontinued | πŸŒ…οΈ discontinued | ❌ | ❌️ | ❌️ | ❌ | -| ^2.0 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^2.1 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^2.2 | ❌ | βœ… | βœ… | ⚠️ experimental | ⚠️ experimental | ⚠️ experimental | -| ^3.0 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.5 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^1.6 | πŸŒ…οΈ | πŸŒ…οΈ | ❌ | ❌ | ❌️ | ❌ | +| ^2.0 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^2.1 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^2.2 | ❌ | βœ… | βœ… | ⚠️ | ⚠️ | ⚠️ | +| ^3.0 | ❌ | ❌ | ❌ | βœ…οΈ | βœ…οΈ | ⚠️ | ### Middleware #### Community Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.0 | ❌ | ❌ | ❌ | ❌️ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.0 | ❌ | ❌ | ❌ | ❌️ | βœ…οΈ | ⚠️ | #### Enterprise Edition -| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | -| ------- | --------------- | --------------- | ------------ | --------------- | --------------- | --------------- | -| ^1.0 | ❌ | ❌ | ❌ | ❌️ | βœ…οΈ | ⚠️ experimental | +* βœ… available +* ❌ no support +* πŸŒ…οΈ discontinued +* ⚠️ experimental + +| Version | PHP 5.6 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | +| ------- | ------- | ------- | ------- | ------- | ------- | ------- | +| ^1.0 | ❌ | ❌ | ❌ | ❌️ | βœ…οΈ | ⚠️ | diff --git a/config/builds.php b/config/builds.php index 68e45d4..601e188 100644 --- a/config/builds.php +++ b/config/builds.php @@ -3,464 +3,496 @@ use Kiboko\Cloud\Domain\Packaging; return function(bool $withExperimental): iterable { - $repository = new Packaging\Repository('kiboko/php'); - - yield new Packaging\Native\Package( - $repository, +// $postgresqlRepository = new Packaging\Repository('kiboko/postgresql'); +// +// yield new Packaging\Native\PostgreSQL\Package( +// $postgresqlRepository, +// '9.6', +// new Packaging\Placeholder('postgresql/'), +// $withExperimental +// ); +// +// yield new Packaging\Native\PostgreSQL\Package( +// $postgresqlRepository, +// '10', +// new Packaging\Placeholder('postgresql/'), +// $withExperimental +// ); +// +// yield new Packaging\Native\PostgreSQL\Package( +// $postgresqlRepository, +// '11', +// new Packaging\Placeholder('postgresql/'), +// $withExperimental +// ); +// +// yield new Packaging\Native\PostgreSQL\Package( +// $postgresqlRepository, +// '12', +// new Packaging\Placeholder('postgresql/'), +// $withExperimental +// ); + + $phpRepository = new Packaging\Repository('kiboko/php'); + + yield new Packaging\Native\PHP\Package( + $phpRepository, '5.6', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), $withExperimental ); - yield new Packaging\Native\Package( - $repository, + yield new Packaging\Native\PHP\Package( + $phpRepository, '7.1', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), $withExperimental ); - yield new Packaging\Native\Package( - $repository, + yield new Packaging\Native\PHP\Package( + $phpRepository, '7.2', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), $withExperimental ); - yield new Packaging\Native\Package( - $repository, + yield new Packaging\Native\PHP\Package( + $phpRepository, '7.3', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), $withExperimental ); - yield new Packaging\Native\Package( - $repository, + yield new Packaging\Native\PHP\Package( + $phpRepository, '7.4', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), $withExperimental ); - yield new Packaging\Native\Package( - $repository, + yield new Packaging\Native\PHP\Package( + $phpRepository, '8.0', new Packaging\Placeholder('native/php@%php.version%/%php.flavor%/'), - new Packaging\Native\Flavor\ExperimentalFlavorRepository(), + $withExperimental ? + new Packaging\Native\PHP\Flavor\StandardFlavorRepository() : + new Packaging\Native\PHP\Flavor\ExperimentalFlavorRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '5.6', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '7.1', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '7.2', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '7.3', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '7.4', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); - yield new Packaging\Native\PackageVariation( - $repository, + yield new Packaging\Native\PHP\PackageVariation( + $phpRepository, '8.0', - new Packaging\Placeholder('%package.variation%/'), - new Packaging\Native\Flavor\ExperimentalFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Placeholder('%package.variation%/php/'), + new Packaging\Native\PHP\Flavor\ExperimentalFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '5.6', new Packaging\Placeholder('oroplatform/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('oroplatform/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('oroplatform/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('oroplatform/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('oroplatform/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '5.6', new Packaging\Placeholder('oroplatform/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('oroplatform/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('oroplatform/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('oroplatform/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('oroplatform/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroPlatformEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('orocommerce/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('orocommerce/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('orocommerce/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('orocommerce/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('orocommerce/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('orocommerce/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('orocommerce/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('orocommerce/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCommerceEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('orocrm/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('orocrm/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('orocrm/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('orocrm/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('orocrm/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('orocrm/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('orocrm/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('orocrm/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\OroCRMEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('marello/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('marello/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('marello/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloCommunityEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('marello/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloCommunityEditionRepository() ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.1', new Packaging\Placeholder('marello/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.2', new Packaging\Placeholder('marello/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.3', new Packaging\Placeholder('marello/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('marello/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MarelloEnterpriseEditionRepository(), $withExperimental ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('middleware/%package.edition%/%package.version%/php@%php.version%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MiddlewareCommunityEditionRepository() ); yield new Packaging\Platform\Package( - $repository, + $phpRepository, '7.4', new Packaging\Placeholder('middleware/%package.edition%/'), - new Packaging\Native\Flavor\StandardFlavorRepository(), - new Packaging\Native\Variation\StandardVariationRepository(), + new Packaging\Native\PHP\Flavor\StandardFlavorRepository(), + new Packaging\Native\PHP\Variation\StandardVariationRepository(), new Packaging\Platform\Edition\MiddlewareEnterpriseEditionRepository() ); }; \ No newline at end of file diff --git a/environments/marello/ce/1.5/php@7.1/Dockerfile b/environments/marello/ce/1.5/php@7.1/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/marello/ce/1.5/php@7.1/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/marello/ce/1.6/php@7.1/Dockerfile b/environments/marello/ce/1.6/php@7.1/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/marello/ce/1.6/php@7.1/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/middleware/ce/1.0/php@7.4/Dockerfile b/environments/middleware/ce/1.0/php@7.4/Dockerfile index 09a9fe6..e9fd5c8 100644 --- a/environments/middleware/ce/1.0/php@7.4/Dockerfile +++ b/environments/middleware/ce/1.0/php@7.4/Dockerfile @@ -29,6 +29,7 @@ RUN set -ex\ && make install \ && cd - \ && echo "extension=rdkafka.so" > /usr/local/etc/php/conf.d/rdkafka.ini \ + && rm -rf php-rdkafka \ ) \ && apk del .build-deps \ && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/mysql/Dockerfile b/environments/mysql/php/Dockerfile similarity index 100% rename from environments/mysql/Dockerfile rename to environments/mysql/php/Dockerfile diff --git a/environments/native/php@5.6/cli/Dockerfile b/environments/native/php@5.6/cli/Dockerfile index 3e9e018..05a3de9 100644 --- a/environments/native/php@5.6/cli/Dockerfile +++ b/environments/native/php@5.6/cli/Dockerfile @@ -20,16 +20,7 @@ RUN set -ex \ npm \ patch \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -55,7 +46,7 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -66,12 +57,15 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require \ friendsofphp/php-cs-fixer \ phpunit/phpunit \ - phpspec/phpspec + phpspec/phpspec \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" diff --git a/environments/native/php@5.6/fpm/Dockerfile b/environments/native/php@5.6/fpm/Dockerfile index 5ec3f59..9fa5ee8 100644 --- a/environments/native/php@5.6/fpm/Dockerfile +++ b/environments/native/php@5.6/fpm/Dockerfile @@ -7,6 +7,9 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker +ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_GROUPNAME} --disable-cgi" +ENV HOME=/opt/${APP_USERNAME} + RUN set -ex \ && addgroup -g ${APP_GID} ${APP_USERNAME} \ && adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \ @@ -16,16 +19,7 @@ RUN set -ex \ wget \ ca-certificates \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -51,11 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/environments/native/php@7.1/cli-xdebug/Dockerfile b/environments/native/php@7.1/cli-xdebug/Dockerfile index 8510b1c..de0ce82 100644 --- a/environments/native/php@7.1/cli-xdebug/Dockerfile +++ b/environments/native/php@7.1/cli-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.1/cli/Dockerfile b/environments/native/php@7.1/cli/Dockerfile index 77af853..4976b7b 100644 --- a/environments/native/php@7.1/cli/Dockerfile +++ b/environments/native/php@7.1/cli/Dockerfile @@ -20,16 +20,7 @@ RUN set -ex \ npm \ patch \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -55,7 +46,7 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -66,13 +57,16 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require \ friendsofphp/php-cs-fixer \ phpunit/phpunit \ phpspec/phpspec \ - infection/infection + infection/infection \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" diff --git a/environments/native/php@7.1/fpm-xdebug/Dockerfile b/environments/native/php@7.1/fpm-xdebug/Dockerfile index 4b38d27..8bd61fc 100644 --- a/environments/native/php@7.1/fpm-xdebug/Dockerfile +++ b/environments/native/php@7.1/fpm-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.1/fpm/Dockerfile b/environments/native/php@7.1/fpm/Dockerfile index 3b38936..8198316 100644 --- a/environments/native/php@7.1/fpm/Dockerfile +++ b/environments/native/php@7.1/fpm/Dockerfile @@ -7,6 +7,9 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker +ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_GROUPNAME} --disable-cgi" +ENV HOME=/opt/${APP_USERNAME} + RUN set -ex \ && addgroup -g ${APP_GID} ${APP_USERNAME} \ && adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \ @@ -16,16 +19,7 @@ RUN set -ex \ wget \ ca-certificates \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -51,11 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/environments/native/php@7.2/cli-xdebug/Dockerfile b/environments/native/php@7.2/cli-xdebug/Dockerfile index f683483..67f9299 100644 --- a/environments/native/php@7.2/cli-xdebug/Dockerfile +++ b/environments/native/php@7.2/cli-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.2/cli/Dockerfile b/environments/native/php@7.2/cli/Dockerfile index 24cbcdb..960a47a 100644 --- a/environments/native/php@7.2/cli/Dockerfile +++ b/environments/native/php@7.2/cli/Dockerfile @@ -20,16 +20,7 @@ RUN set -ex \ npm \ patch \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -55,7 +46,7 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -66,13 +57,16 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require \ friendsofphp/php-cs-fixer \ phpunit/phpunit \ phpspec/phpspec \ - infection/infection + infection/infection \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" diff --git a/environments/native/php@7.2/fpm-xdebug/Dockerfile b/environments/native/php@7.2/fpm-xdebug/Dockerfile index 74029e9..1df4eee 100644 --- a/environments/native/php@7.2/fpm-xdebug/Dockerfile +++ b/environments/native/php@7.2/fpm-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.2/fpm/Dockerfile b/environments/native/php@7.2/fpm/Dockerfile index 13fd796..8a1c265 100644 --- a/environments/native/php@7.2/fpm/Dockerfile +++ b/environments/native/php@7.2/fpm/Dockerfile @@ -7,6 +7,9 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker +ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_GROUPNAME} --disable-cgi" +ENV HOME=/opt/${APP_USERNAME} + RUN set -ex \ && addgroup -g ${APP_GID} ${APP_USERNAME} \ && adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \ @@ -16,16 +19,7 @@ RUN set -ex \ wget \ ca-certificates \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -51,11 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/environments/native/php@7.3/cli-xdebug/Dockerfile b/environments/native/php@7.3/cli-xdebug/Dockerfile index 6559fe8..3a38263 100644 --- a/environments/native/php@7.3/cli-xdebug/Dockerfile +++ b/environments/native/php@7.3/cli-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.3/cli/Dockerfile b/environments/native/php@7.3/cli/Dockerfile index ac0e0fa..db6d4b0 100644 --- a/environments/native/php@7.3/cli/Dockerfile +++ b/environments/native/php@7.3/cli/Dockerfile @@ -20,16 +20,7 @@ RUN set -ex \ npm \ patch \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -51,12 +42,11 @@ RUN set -ex \ libmagic \ libtool \ mpc1 \ - musl-dev \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -67,13 +57,16 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require \ friendsofphp/php-cs-fixer \ phpunit/phpunit:^8.5 \ phpspec/phpspec \ - infection/infection + infection/infection \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" diff --git a/environments/native/php@7.3/fpm-xdebug/Dockerfile b/environments/native/php@7.3/fpm-xdebug/Dockerfile index 1e6a375..825534c 100644 --- a/environments/native/php@7.3/fpm-xdebug/Dockerfile +++ b/environments/native/php@7.3/fpm-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.3/fpm/Dockerfile b/environments/native/php@7.3/fpm/Dockerfile index a4cf227..e9dd7b8 100644 --- a/environments/native/php@7.3/fpm/Dockerfile +++ b/environments/native/php@7.3/fpm/Dockerfile @@ -7,6 +7,9 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker +ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_GROUPNAME} --disable-cgi" +ENV HOME=/opt/${APP_USERNAME} + RUN set -ex \ && addgroup -g ${APP_GID} ${APP_USERNAME} \ && adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \ @@ -16,16 +19,7 @@ RUN set -ex \ wget \ ca-certificates \ && update-ca-certificates \ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + && apk add --virtual .build-deps $PHPIZE_DEPS \ && docker-php-ext-install opcache \ && apk add --update icu-dev icu \ && docker-php-ext-configure intl \ @@ -51,11 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/environments/native/php@7.4/cli-xdebug/Dockerfile b/environments/native/php@7.4/cli-xdebug/Dockerfile index 2ea459f..95ba205 100644 --- a/environments/native/php@7.4/cli-xdebug/Dockerfile +++ b/environments/native/php@7.4/cli-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.4/cli/Dockerfile b/environments/native/php@7.4/cli/Dockerfile index ebaa022..3f9c723 100644 --- a/environments/native/php@7.4/cli/Dockerfile +++ b/environments/native/php@7.4/cli/Dockerfile @@ -46,7 +46,7 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -57,13 +57,16 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require \ friendsofphp/php-cs-fixer \ phpunit/phpunit:^8.5 \ phpspec/phpspec \ - infection/infection + infection/infection \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" diff --git a/environments/native/php@7.4/fpm-xdebug/Dockerfile b/environments/native/php@7.4/fpm-xdebug/Dockerfile index a40ae21..aaebf1d 100644 --- a/environments/native/php@7.4/fpm-xdebug/Dockerfile +++ b/environments/native/php@7.4/fpm-xdebug/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex\ m4 \ make \ && docker-php-source extract \ - && pecl install xdebug-2.9.0 \ + && pecl install xdebug-2.9.6 \ && docker-php-ext-enable xdebug \ && docker-php-source delete \ && apk del .build-deps \ diff --git a/environments/native/php@7.4/fpm/Dockerfile b/environments/native/php@7.4/fpm/Dockerfile index b1d838d..82d5831 100644 --- a/environments/native/php@7.4/fpm/Dockerfile +++ b/environments/native/php@7.4/fpm/Dockerfile @@ -45,11 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ - python \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/environments/native/php@8.0/cli-blackfire/Dockerfile b/environments/native/php@8.0/cli-blackfire/Dockerfile new file mode 100644 index 0000000..f256651 --- /dev/null +++ b/environments/native/php@8.0/cli-blackfire/Dockerfile @@ -0,0 +1,15 @@ +FROM kiboko/php:8.0-cli + +LABEL maintainer="GrΓ©gory Planchat " + +# From: https://blackfire.io/docs/integrations/docker +ENV current_os=alpine +RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/$current_os/amd64/$version \ + && mkdir -p /tmp/blackfire \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ + && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ + && curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire /usr/bin/blackfire \ + && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz \ No newline at end of file diff --git a/environments/native/php@8.0/cli-xdebug/Dockerfile b/environments/native/php@8.0/cli-xdebug/Dockerfile new file mode 100644 index 0000000..f1920d9 --- /dev/null +++ b/environments/native/php@8.0/cli-xdebug/Dockerfile @@ -0,0 +1,34 @@ +FROM kiboko/php:8.0-cli + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + && docker-php-source extract \ + && ( \ + git clone git://github.com/xdebug/xdebug.git \ + && cd xdebug \ + && phpize \ + && autoconf \ + && ./configure \ + && make all -j5 \ + && make install \ + && cd - \ + && echo "extension=xdeubg.so" > /usr/local/etc/php/conf.d/xdebug.ini \ + && rm -rf xdebug/ \ + ) \ + && docker-php-source delete \ + && apk del .build-deps \ + && rm -rf /tmp/* /var/cache/apk/* + +COPY config/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini + diff --git a/environments/native/php@8.0/cli/Dockerfile b/environments/native/php@8.0/cli/Dockerfile index a3335c0..0b4863a 100644 --- a/environments/native/php@8.0/cli/Dockerfile +++ b/environments/native/php@8.0/cli/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM php:8.0-rc-cli-alpine LABEL maintainer="GrΓ©gory Planchat " @@ -7,196 +7,6 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - tar \ - gzip \ -# https://github.com/docker-library/php/issues/494 - openssl - -# ensure www-data user exists -RUN set -eux; \ - addgroup -g 82 -S www-data; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.9-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F - -ENV PHP_VERSION 8.0.0-dev -ENV PHP_URL="https://github.com/php/php-src/archive/master.tar.gz" PHP_ASC_URL="" -ENV PHP_SHA256="" PHP_MD5="" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.gz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.gz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.gz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.gz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.gz.asc php.tar.gz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - bison \ - argon2-dev \ - coreutils \ - curl-dev \ - libedit-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - sqlite-dev \ - ; \ - \ - export CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./buildconf ; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] - -WORKDIR /var/www/html - -CMD ["php", "-a"] - - RUN set -ex \ && addgroup -g ${APP_GID} ${APP_USERNAME} \ && adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME} \ @@ -236,6 +46,7 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ + python3 \ re2c \ readline \ sqlite-libs \ @@ -246,15 +57,16 @@ RUN set -ex \ && if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi \ && php composer-setup.php --install-dir /usr/local/bin --filename composer \ && php -r "unlink('composer-setup.php');" \ - && mkdir -p /opt/docker/.npm \ - && chown docker:docker /opt/docker/.npm - -RUN composer global init \ + && mkdir -p /opt/${APP_USERNAME}/.npm \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown ${APP_USERNAME}:${APP_GROUPNAME} /opt/docker/.npm \ + && composer global init \ && composer global require --ignore-platform-reqs \ friendsofphp/php-cs-fixer \ phpunit/phpunit:^8.5 \ phpspec/phpspec \ - infection/infection + infection/infection \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV PATH="/opt/${APP_USERNAME}/.composer/vendor/bin:${PATH}" @@ -262,3 +74,5 @@ ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini COPY config/opcache.ini /usr/local/etc/php/conf.d/opcache.ini + +WORKDIR /var/www/html diff --git a/environments/native/php@8.0/cli/docker-php-entrypoint b/environments/native/php@8.0/cli/docker-php-entrypoint deleted file mode 100755 index 88a016c..0000000 --- a/environments/native/php@8.0/cli/docker-php-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- php "$@" -fi - -exec "$@" diff --git a/environments/native/php@8.0/cli/docker-php-ext-configure b/environments/native/php@8.0/cli/docker-php-ext-configure deleted file mode 100755 index 34fc133..0000000 --- a/environments/native/php@8.0/cli/docker-php-ext-configure +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 ext-name [configure flags]" - echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -ext="$1" -if [ -z "$ext" ] || [ ! -d "$ext" ]; then - usage >&2 - exit 1 -fi -shift - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS - fi -fi - -if command -v dpkg-architecture > /dev/null; then - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" - set -- --build="$gnuArch" "$@" -fi - -cd "$ext" -phpize -./configure --enable-option-checking=fatal "$@" diff --git a/environments/native/php@8.0/cli/docker-php-ext-enable b/environments/native/php@8.0/cli/docker-php-ext-enable deleted file mode 100755 index 8137f79..0000000 --- a/environments/native/php@8.0/cli/docker-php-ext-enable +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -set -e - -extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" -cd "$extDir" - -usage() { - echo "usage: $0 [options] module-name [module-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 --ini-name 0-apc.ini apcu apc" - echo - echo 'Possible values for module-name:' - find -maxdepth 1 \ - -type f \ - -name '*.so' \ - -exec basename '{}' ';' \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -modules= -for module; do - if [ -z "$module" ]; then - continue - fi - if [ -f "$module.so" ] && ! [ -f "$module" ]; then - # allow ".so" to be optional - module="$module.so" - fi - if ! [ -f "$module" ]; then - echo >&2 "error: '$module' does not exist" - echo >&2 - usage >&2 - exit 1 - fi - modules="$modules $module" -done - -if [ -z "$modules" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils - apkDel='.docker-php-ext-enable-deps' - fi -fi - -for module in $modules; do - if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - absModule="$(readlink -f "$module")" - line="zend_extension=$absModule" - else - line="extension=$module" - fi - - ext="$(basename "$module")" - ext="${ext%.*}" - if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then - # this isn't perfect, but it's better than nothing - # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') - echo >&2 - echo >&2 "warning: $ext ($module) is already loaded!" - echo >&2 - continue - fi - - case "$iniName" in - /*) - # allow an absolute path - ini="$iniName" - ;; - *) - ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" - ;; - esac - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi diff --git a/environments/native/php@8.0/cli/docker-php-ext-install b/environments/native/php@8.0/cli/docker-php-ext-install deleted file mode 100755 index f377be4..0000000 --- a/environments/native/php@8.0/cli/docker-php-ext-install +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" - echo - echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -j=1 -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --jobs|-j) j="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -exts= -for ext; do - if [ -z "$ext" ]; then - continue - fi - if [ ! -d "$ext" ]; then - echo >&2 "error: $PWD/$ext does not exist" - echo >&2 - usage >&2 - exit 1 - fi - exts="$exts $ext" -done - -if [ -z "$exts" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if [ -n "$PHPIZE_DEPS" ]; then - if apk info --installed .phpize-deps-configure > /dev/null; then - apkDel='.phpize-deps-configure' - elif ! apk info --installed .phpize-deps > /dev/null; then - apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS - apkDel='.phpize-deps' - fi - fi -fi - -popDir="$PWD" -for ext in $exts; do - cd "$ext" - [ -e Makefile ] || docker-php-ext-configure "$ext" - make -j"$j" - make -j"$j" install - find modules \ - -maxdepth 1 \ - -name '*.so' \ - -exec basename '{}' ';' \ - | xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"} - make -j"$j" clean - cd "$popDir" -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi - -if [ -e /usr/src/php/.docker-delete-me ]; then - docker-php-source delete -fi diff --git a/environments/native/php@8.0/cli/docker-php-source b/environments/native/php@8.0/cli/docker-php-source deleted file mode 100755 index 833f804..0000000 --- a/environments/native/php@8.0/cli/docker-php-source +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -dir=/usr/src/php - -usage() { - echo "usage: $0 COMMAND" - echo - echo "Manage php source tarball lifecycle." - echo - echo "Commands:" - echo " extract extract php source tarball into directory $dir if not already done." - echo " delete delete extracted php source located into $dir if not already done." - echo -} - -case "$1" in - extract) - mkdir -p "$dir" - if [ ! -f "$dir/.docker-extracted" ]; then - tar -zxf /usr/src/php.tar.gz -C "$dir" --strip-components=1 - touch "$dir/.docker-extracted" - fi - ;; - - delete) - rm -rf "$dir" - ;; - - *) - usage - exit 1 - ;; -esac diff --git a/environments/native/php@8.0/fpm-blackfire/Dockerfile b/environments/native/php@8.0/fpm-blackfire/Dockerfile new file mode 100644 index 0000000..f2cd58d --- /dev/null +++ b/environments/native/php@8.0/fpm-blackfire/Dockerfile @@ -0,0 +1,13 @@ +FROM kiboko/php:8.0-fpm + +LABEL maintainer="GrΓ©gory Planchat " + +# From: https://blackfire.io/docs/integrations/docker +ENV current_os=alpine +RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/$current_os/amd64/$version \ + && mkdir -p /tmp/blackfire \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ + && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ + && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz \ No newline at end of file diff --git a/environments/native/php@8.0/fpm-xdebug/Dockerfile b/environments/native/php@8.0/fpm-xdebug/Dockerfile new file mode 100644 index 0000000..8fde0fb --- /dev/null +++ b/environments/native/php@8.0/fpm-xdebug/Dockerfile @@ -0,0 +1,34 @@ +FROM kiboko/php:8.0-fpm + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + && docker-php-source extract \ + && ( \ + git clone git://github.com/xdebug/xdebug.git \ + && cd xdebug \ + && phpize \ + && autoconf \ + && ./configure \ + && make all -j5 \ + && make install \ + && cd - \ + && echo "extension=xdeubg.so" > /usr/local/etc/php/conf.d/xdebug.ini \ + && rm -rf xdebug/ \ + ) \ + && docker-php-source delete \ + && apk del .build-deps \ + && rm -rf /tmp/* /var/cache/apk/* + +COPY config/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini + diff --git a/environments/native/php@8.0/fpm/Dockerfile b/environments/native/php@8.0/fpm/Dockerfile index 3bb9484..f598934 100644 --- a/environments/native/php@8.0/fpm/Dockerfile +++ b/environments/native/php@8.0/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.12 +FROM php:8.0-rc-fpm-alpine LABEL maintainer="GrΓ©gory Planchat " @@ -7,242 +7,7 @@ ARG APP_GID=1000 ARG APP_USERNAME=docker ARG APP_GROUPNAME=docker -# dependencies required for running "phpize" -# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev dpkg \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkgconf \ - re2c - -# persistent / runtime deps -RUN apk add --no-cache \ - ca-certificates \ - curl \ - tar \ - gzip \ -# https://github.com/docker-library/php/issues/494 - openssl - -# ensure www-data user exists -RUN set -eux; \ - addgroup -g 82 -S www-data; \ - adduser -u 82 -D -S -G www-data www-data -# 82 is the standard uid/gid for "www-data" in Alpine -# https://git.alpinelinux.org/aports/tree/main/apache2/apache2.pre-install?h=3.9-stable -# https://git.alpinelinux.org/aports/tree/main/lighttpd/lighttpd.pre-install?h=3.9-stable -# https://git.alpinelinux.org/aports/tree/main/nginx/nginx.pre-install?h=3.9-stable - -ENV PHP_INI_DIR /usr/local/etc/php -RUN set -eux; \ - mkdir -p "$PHP_INI_DIR/conf.d"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - [ ! -d /var/www/html ]; \ - mkdir -p /var/www/html; \ - chown www-data:www-data /var/www/html; \ - chmod 777 /var/www/html - -#### -ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_USERNAME} --disable-cgi -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# https://github.com/docker-library/php/issues/272 -# -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -pie" - -ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 BFDDD28642824F8118EF77909B67A5C12229118F - -ENV PHP_VERSION 8.0.0-dev -ENV PHP_URL="https://github.com/php/php-src/archive/master.tar.gz" PHP_ASC_URL="" -ENV PHP_SHA256="" PHP_MD5="" - -RUN set -eux; \ - \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - curl -fsSL -o php.tar.gz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.gz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.gz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - curl -fsSL -o php.tar.gz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.gz.asc php.tar.gz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apk del --no-network .fetch-deps - -COPY docker-php-source /usr/local/bin/ - -RUN set -eux; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - bison \ - argon2-dev \ - coreutils \ - curl-dev \ - libedit-dev \ - libsodium-dev \ - libxml2-dev \ - linux-headers \ - oniguruma-dev \ - openssl-dev \ - sqlite-dev \ - ; \ - \ - export CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./buildconf ; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors instead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself) - --enable-mysqlnd \ -# https://wiki.php.net/rfc/argon2_password_hash (7.2+) - --with-password-argon2 \ -# https://wiki.php.net/rfc/libsodium - --with-sodium=shared \ -# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109) - --with-pdo-sqlite=/usr \ - --with-sqlite3=/usr \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 - --with-pear \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-musl' && echo '--without-pcre-jit') \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-cache $runDeps; \ - \ - apk del --no-network .build-deps; \ - \ -# update pecl channel definitions https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc; \ -# smoke test - php --version - -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] - -WORKDIR /var/www/html - -RUN set -eux; \ - cd /usr/local/etc; \ - if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi; \ - { \ - echo '[global]'; \ - echo 'error_log = /proc/self/fd/2'; \ - echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ - echo; \ - echo '[www]'; \ - echo '; if we send this to /proc/self/fd/1, it never appears'; \ - echo 'access.log = /proc/self/fd/2'; \ - echo; \ - echo 'clear_env = no'; \ - echo; \ - echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ - echo 'catch_workers_output = yes'; \ - echo 'decorate_workers_output = no'; \ - } | tee php-fpm.d/docker.conf; \ - { \ - echo '[global]'; \ - echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ - } | tee php-fpm.d/zz-docker.conf - -# Override stop signal to stop process gracefully -# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 -STOPSIGNAL SIGQUIT - -EXPOSE 9000 -CMD ["php-fpm"] - +ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-fpm --with-fpm-user=${APP_USERNAME} --with-fpm-group=${APP_GROUPNAME} --disable-cgi" ENV HOME=/opt/${APP_USERNAME} RUN set -ex \ @@ -280,10 +45,13 @@ RUN set -ex \ perl \ pkgconf \ pkgconfig \ + python3 \ re2c \ readline \ sqlite-libs \ - && rm -rf /tmp/* /var/cache/apk/* + && rm -rf /tmp/* /var/cache/apk/* \ + && mkdir -p /opt/${APP_USERNAME}/.composer \ + && chown -R ${APP_USERNAME}:${APP_GROUPNAME} /opt/${APP_USERNAME} ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php @@ -291,3 +59,4 @@ COPY config/pool.ini /usr/local/etc/php/pool.d/default.ini COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini COPY config/opcache.ini /usr/local/etc/php/conf.d/opcache.ini +WORKDIR /var/www/html diff --git a/environments/native/php@8.0/fpm/docker-php-entrypoint b/environments/native/php@8.0/fpm/docker-php-entrypoint deleted file mode 100755 index 86343d8..0000000 --- a/environments/native/php@8.0/fpm/docker-php-entrypoint +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -# first arg is `-f` or `--some-option` -if [ "${1#-}" != "$1" ]; then - set -- php-fpm "$@" -fi - -exec "$@" diff --git a/environments/native/php@8.0/fpm/docker-php-ext-configure b/environments/native/php@8.0/fpm/docker-php-ext-configure deleted file mode 100755 index 34fc133..0000000 --- a/environments/native/php@8.0/fpm/docker-php-ext-configure +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 ext-name [configure flags]" - echo " ie: $0 gd --with-jpeg-dir=/usr/local/something" - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -ext="$1" -if [ -z "$ext" ] || [ ! -d "$ext" ]; then - usage >&2 - exit 1 -fi -shift - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS - fi -fi - -if command -v dpkg-architecture > /dev/null; then - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" - set -- --build="$gnuArch" "$@" -fi - -cd "$ext" -phpize -./configure --enable-option-checking=fatal "$@" diff --git a/environments/native/php@8.0/fpm/docker-php-ext-enable b/environments/native/php@8.0/fpm/docker-php-ext-enable deleted file mode 100755 index 8137f79..0000000 --- a/environments/native/php@8.0/fpm/docker-php-ext-enable +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -set -e - -extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')" -cd "$extDir" - -usage() { - echo "usage: $0 [options] module-name [module-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 --ini-name 0-apc.ini apcu apc" - echo - echo 'Possible values for module-name:' - find -maxdepth 1 \ - -type f \ - -name '*.so' \ - -exec basename '{}' ';' \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -modules= -for module; do - if [ -z "$module" ]; then - continue - fi - if [ -f "$module.so" ] && ! [ -f "$module" ]; then - # allow ".so" to be optional - module="$module.so" - fi - if ! [ -f "$module" ]; then - echo >&2 "error: '$module' does not exist" - echo >&2 - usage >&2 - exit 1 - fi - modules="$modules $module" -done - -if [ -z "$modules" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if \ - [ -n "$PHPIZE_DEPS" ] \ - && ! apk info --installed .phpize-deps > /dev/null \ - && ! apk info --installed .phpize-deps-configure > /dev/null \ - ; then - apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils - apkDel='.docker-php-ext-enable-deps' - fi -fi - -for module in $modules; do - if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - absModule="$(readlink -f "$module")" - line="zend_extension=$absModule" - else - line="extension=$module" - fi - - ext="$(basename "$module")" - ext="${ext%.*}" - if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then - # this isn't perfect, but it's better than nothing - # (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache') - echo >&2 - echo >&2 "warning: $ext ($module) is already loaded!" - echo >&2 - continue - fi - - case "$iniName" in - /*) - # allow an absolute path - ini="$iniName" - ;; - *) - ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}" - ;; - esac - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi diff --git a/environments/native/php@8.0/fpm/docker-php-ext-install b/environments/native/php@8.0/fpm/docker-php-ext-install deleted file mode 100755 index f377be4..0000000 --- a/environments/native/php@8.0/fpm/docker-php-ext-install +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -set -e - -# prefer user supplied CFLAGS, but default to our PHP_CFLAGS -: ${CFLAGS:=$PHP_CFLAGS} -: ${CPPFLAGS:=$PHP_CPPFLAGS} -: ${LDFLAGS:=$PHP_LDFLAGS} -export CFLAGS CPPFLAGS LDFLAGS - -srcExists= -if [ -d /usr/src/php ]; then - srcExists=1 -fi -docker-php-source extract -if [ -z "$srcExists" ]; then - touch /usr/src/php/.docker-delete-me -fi - -cd /usr/src/php/ext - -usage() { - echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]" - echo " ie: $0 gd mysqli" - echo " $0 pdo pdo_mysql" - echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop" - echo - echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure' - echo - echo 'Possible values for ext-name:' - find . \ - -mindepth 2 \ - -maxdepth 2 \ - -type f \ - -name 'config.m4' \ - | xargs -n1 dirname \ - | xargs -n1 basename \ - | sort \ - | xargs - echo - echo 'Some of the above modules are already compiled into PHP; please check' - echo 'the output of "php -i" to see which modules are already loaded.' -} - -opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })" -eval set -- "$opts" - -j=1 -iniName= -while true; do - flag="$1" - shift - case "$flag" in - --help|-h|'-?') usage && exit 0 ;; - --ini-name) iniName="$1" && shift ;; - --jobs|-j) j="$1" && shift ;; - --) break ;; - *) - { - echo "error: unknown flag: $flag" - usage - } >&2 - exit 1 - ;; - esac -done - -exts= -for ext; do - if [ -z "$ext" ]; then - continue - fi - if [ ! -d "$ext" ]; then - echo >&2 "error: $PWD/$ext does not exist" - echo >&2 - usage >&2 - exit 1 - fi - exts="$exts $ext" -done - -if [ -z "$exts" ]; then - usage >&2 - exit 1 -fi - -pm='unknown' -if [ -e /lib/apk/db/installed ]; then - pm='apk' -fi - -apkDel= -if [ "$pm" = 'apk' ]; then - if [ -n "$PHPIZE_DEPS" ]; then - if apk info --installed .phpize-deps-configure > /dev/null; then - apkDel='.phpize-deps-configure' - elif ! apk info --installed .phpize-deps > /dev/null; then - apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS - apkDel='.phpize-deps' - fi - fi -fi - -popDir="$PWD" -for ext in $exts; do - cd "$ext" - [ -e Makefile ] || docker-php-ext-configure "$ext" - make -j"$j" - make -j"$j" install - find modules \ - -maxdepth 1 \ - -name '*.so' \ - -exec basename '{}' ';' \ - | xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"} - make -j"$j" clean - cd "$popDir" -done - -if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then - apk del --no-network $apkDel -fi - -if [ -e /usr/src/php/.docker-delete-me ]; then - docker-php-source delete -fi diff --git a/environments/native/php@8.0/fpm/docker-php-source b/environments/native/php@8.0/fpm/docker-php-source deleted file mode 100755 index 833f804..0000000 --- a/environments/native/php@8.0/fpm/docker-php-source +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -dir=/usr/src/php - -usage() { - echo "usage: $0 COMMAND" - echo - echo "Manage php source tarball lifecycle." - echo - echo "Commands:" - echo " extract extract php source tarball into directory $dir if not already done." - echo " delete delete extracted php source located into $dir if not already done." - echo -} - -case "$1" in - extract) - mkdir -p "$dir" - if [ ! -f "$dir/.docker-extracted" ]; then - tar -zxf /usr/src/php.tar.gz -C "$dir" --strip-components=1 - touch "$dir/.docker-extracted" - fi - ;; - - delete) - rm -rf "$dir" - ;; - - *) - usage - exit 1 - ;; -esac diff --git a/environments/orocommerce/ce/1.6/php@5.6/Dockerfile b/environments/orocommerce/ce/1.6/php@5.6/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/orocommerce/ce/1.6/php@5.6/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/orocommerce/ce/1.6/php@7.1/Dockerfile b/environments/orocommerce/ce/1.6/php@7.1/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/orocommerce/ce/1.6/php@7.1/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/orocrm/ce/2.6/php@5.6/Dockerfile b/environments/orocrm/ce/2.6/php@5.6/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/orocrm/ce/2.6/php@5.6/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/orocrm/ce/2.6/php@7.1/Dockerfile b/environments/orocrm/ce/2.6/php@7.1/Dockerfile new file mode 100644 index 0000000..0ad5988 --- /dev/null +++ b/environments/orocrm/ce/2.6/php@7.1/Dockerfile @@ -0,0 +1,36 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + libxml2-dev \ + tidyhtml-dev \ + openldap-dev \ + libmcrypt-dev \ + && apk add \ + tidyhtml \ + openldap \ + libmcrypt \ + && docker-php-ext-configure soap \ + && docker-php-ext-install soap \ + && docker-php-ext-configure bcmath \ + && docker-php-ext-install bcmath \ + && docker-php-ext-configure tidy \ + && docker-php-ext-install tidy \ + && docker-php-ext-configure ldap --with-ldap \ + && docker-php-ext-install ldap \ + && docker-php-ext-configure mcrypt --with-mcrypt \ + && docker-php-ext-install mcrypt \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/oroplatform/ce/2.6/php@5.6/Dockerfile b/environments/oroplatform/ce/2.6/php@5.6/Dockerfile index 86ea869..34a56c4 100644 --- a/environments/oroplatform/ce/2.6/php@5.6/Dockerfile +++ b/environments/oroplatform/ce/2.6/php@5.6/Dockerfile @@ -6,15 +6,7 @@ LABEL maintainer="GrΓ©gory Planchat " RUN set -ex\ && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ + $PHPIZE_DEPS \ libxml2-dev \ libmcrypt-dev \ libpng-dev \ @@ -24,7 +16,6 @@ RUN set -ex\ krb5-dev \ imap-dev \ openssl-dev \ - $PHPIZE_DEPS \ && apk add --update \ libmcrypt \ freetype \ diff --git a/environments/oroplatform/ce/2.6/php@7.1/Dockerfile b/environments/oroplatform/ce/2.6/php@7.1/Dockerfile new file mode 100644 index 0000000..b34b69b --- /dev/null +++ b/environments/oroplatform/ce/2.6/php@7.1/Dockerfile @@ -0,0 +1,32 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex \ + && apk add --virtual .build-deps \ + $PHPIZE_DEPS \ + libpng-dev \ + libjpeg-turbo-dev \ + freetype-dev \ + zlib-dev \ + krb5-dev \ + imap-dev \ + openssl-dev \ + && apk add --update \ + freetype \ + libpng \ + libjpeg-turbo \ + c-client \ + openssl \ + && docker-php-source extract \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure zip \ + && docker-php-ext-install zip \ + && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-install imap \ + && docker-php-source delete \ + && apk del .build-deps \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/postgresql/Dockerfile b/environments/postgresql/Dockerfile index 2fd1658..57ac118 100644 --- a/environments/postgresql/Dockerfile +++ b/environments/postgresql/Dockerfile @@ -1,25 +1,3 @@ -ARG SOURCE_VARIATION +FROM postgres:9.6-alpine -FROM kiboko/php:${SOURCE_VARIATION} - -LABEL maintainer="GrΓ©gory Planchat " - -RUN set -ex\ - && apk add --virtual .build-deps \ - autoconf \ - bash \ - binutils \ - expat \ - file \ - g++ \ - gcc \ - m4 \ - make \ - postgresql-dev \ - && apk add --update \ - libpq \ - postgresql-client \ - && docker-php-ext-configure pdo_pgsql \ - && docker-php-ext-install pdo_pgsql \ - && apk del .build-deps \ - && rm -rf /tmp/* /var/cache/apk/* +COPY uuid-ossp.sql /docker-entrypoint-initdb.d/00-uuid-ossp.sql \ No newline at end of file diff --git a/environments/postgresql/php/Dockerfile b/environments/postgresql/php/Dockerfile new file mode 100644 index 0000000..2fd1658 --- /dev/null +++ b/environments/postgresql/php/Dockerfile @@ -0,0 +1,25 @@ +ARG SOURCE_VARIATION + +FROM kiboko/php:${SOURCE_VARIATION} + +LABEL maintainer="GrΓ©gory Planchat " + +RUN set -ex\ + && apk add --virtual .build-deps \ + autoconf \ + bash \ + binutils \ + expat \ + file \ + g++ \ + gcc \ + m4 \ + make \ + postgresql-dev \ + && apk add --update \ + libpq \ + postgresql-client \ + && docker-php-ext-configure pdo_pgsql \ + && docker-php-ext-install pdo_pgsql \ + && apk del .build-deps \ + && rm -rf /tmp/* /var/cache/apk/* diff --git a/environments/postgresql/uuid-ossp.sql b/environments/postgresql/uuid-ossp.sql new file mode 100644 index 0000000..682131d --- /dev/null +++ b/environments/postgresql/uuid-ossp.sql @@ -0,0 +1 @@ +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; \ No newline at end of file diff --git a/src/Domain/Packaging/CommandBus/ParallelCommandRunner.php b/src/Domain/Packaging/CommandBus/ParallelCommandRunner.php deleted file mode 100644 index 0448823..0000000 --- a/src/Domain/Packaging/CommandBus/ParallelCommandRunner.php +++ /dev/null @@ -1,96 +0,0 @@ -input = $input; - $this->output = $output; - $this->maxProcesses = $maxProcesses; - $this->poll = $poll; - } - - public function run(CommandBusInterface $commandBus, string $rootPath) - { - $iterator = new \RecursiveIteratorIterator($commandBus, \RecursiveIteratorIterator::SELF_FIRST); - - /** @var ConsoleSectionOutput $section */ - $progressBar = new ProgressBar($this->output->section(), iterator_count($iterator)); - - // do not modify the object pointers in the argument, copy to local working variable - $processes = new \SplObjectStorage(); - $processesQueue = array_map(function (Packaging\Command\CommandInterface $command) use ($processes, $rootPath): Process { - $process = $command($rootPath); - $processes[$process] = $command; - - return $process; - }, iterator_to_array($iterator)); - - // fix maxParallel to be max the number of processes or positive - $maxParallel = min(abs($this->maxProcesses), count($processesQueue)); - - // get the first stack of processes to start at the same time - /** @var Process[] $currentProcesses */ - $currentProcesses = array_splice($processesQueue, 0, $maxParallel); - - $sections = new \SplObjectStorage(); - // start the initial stack of processes - foreach ($currentProcesses as $index => $process) { - $process->start(); - /** @var ConsoleSectionOutput $section */ - $section = $sections[$process] = $this->output->section(); - $section->overwrite(sprintf('Running: %s', (string) $processes[$process])); - } - - do { - // wait for the given time - usleep($this->poll); - - // remove all finished processes from the stack - foreach ($currentProcesses as $index => $process) { - if (!$process->isRunning()) { - $progressBar->advance(); - /** @var ConsoleSectionOutput $section */ - $section = $sections[$process]; - unset($sections[$process]); - unset($currentProcesses[$index]); - - // directly add and start new process after the previous finished - if (count($processesQueue) > 0) { - $nextProcess = array_shift($processesQueue); - $nextProcess->start(/*function ($type, $buffer) use ($callback, $nextProcess) { - if (null !== $callback && is_callable($callback)) { - $callback($type, $buffer, $nextProcess); - } - }*/); - $sections[$nextProcess] = $section; - $currentProcesses[] = $nextProcess; - $section->overwrite(sprintf('Running: %s', (string) $processes[$nextProcess])); - } else { - $section->overwrite('Finished!'); - } - } - } - // continue loop while there are processes being executed or waiting for execution - } while (count($processesQueue) > 0 || count($currentProcesses) > 0); - } -} diff --git a/src/Domain/Packaging/Execution/CommandBus/ParallelCommandRunner.php b/src/Domain/Packaging/Execution/CommandBus/ParallelCommandRunner.php new file mode 100644 index 0000000..aeb35d5 --- /dev/null +++ b/src/Domain/Packaging/Execution/CommandBus/ParallelCommandRunner.php @@ -0,0 +1,48 @@ +input = $input; + $this->output = $output; + $this->maxProcesses = $maxProcesses; + $this->poll = $poll; + } + + public function run(CommandBusInterface $commandBus, string $rootPath) + { + /** @var ConsoleSectionOutput $section */ + $progressBar = new ProgressBar($this->output->section(), count($commandBus)); + + $queue = new TaskQueue($commandBus, min(abs($this->maxProcesses), $commandBus->countProcesses())); + + $queue->start(); + do { + // wait for the given time + usleep($this->poll); + + $queue->poll(function () use ($progressBar) { + $progressBar->advance(); + }); + } while ($queue->finished()); + } +} diff --git a/src/Domain/Packaging/Execution/CommandBus/ProcessRegistry.php b/src/Domain/Packaging/Execution/CommandBus/ProcessRegistry.php new file mode 100644 index 0000000..b04900d --- /dev/null +++ b/src/Domain/Packaging/Execution/CommandBus/ProcessRegistry.php @@ -0,0 +1,63 @@ +storage = new \SplObjectStorage(); + } + + public function offsetExists($offset) + { + return $this->storage->offsetExists($offset); + } + + public function offsetGet($offset) + { + return $this->storage->offsetGet($offset); + } + + public function offsetSet($offset, $value) + { + $this->storage->offsetSet($offset, $value); + } + + public function offsetUnset($offset) + { + $this->storage->offsetUnset($offset); + } + + public function current() + { + return $this->storage->current(); + } + + public function next() + { + $this->storage->next(); + } + + public function key() + { + return $this->storage->key(); + } + + public function valid() + { + return $this->storage->valid(); + } + + public function rewind() + { + $this->storage->rewind(); + } + + public function count() + { + return $this->storage->count(); + } +} \ No newline at end of file diff --git a/src/Domain/Packaging/Execution/CommandBus/TaskQueue.php b/src/Domain/Packaging/Execution/CommandBus/TaskQueue.php new file mode 100644 index 0000000..c0ad986 --- /dev/null +++ b/src/Domain/Packaging/Execution/CommandBus/TaskQueue.php @@ -0,0 +1,75 @@ +taskQueue = new \SplQueue(); + $this->processRegistry = new ProcessRegistry(); + $this->maxParallelism = $maxParallelism; + $this->currentTasks = []; + + foreach ($commandBus as $task) { + $this->taskQueue->enqueue(new TaskRunner($this->processRegistry, $task)); + } + } + + public function start(): void + { + if ($this->maxParallelism <= count($this->processRegistry)) { + return; + } + + while ($this->maxParallelism > count($this->currentTasks)) { + $taskRunner = $this->taskQueue->dequeue(); + + if ($taskRunner->finished()) { + continue; + } + + $this->currentTasks[] = $taskRunner; + } + + foreach ($this->currentTasks as $taskRunner) { + $taskRunner->next(); + } + } + + public function poll(callable $onFinish): void + { + $currentTasks = $this->currentTasks; + $this->currentTasks = []; + foreach ($currentTasks as $taskRunner) { + if ($taskRunner->isBusy()) { + $this->currentTasks[] = $taskRunner; + continue; + } + + if (!$taskRunner->finished()) { + $taskRunner->next(); + $this->currentTasks[] = $taskRunner; + continue; + } + + $this->currentTasks[] = $taskRunner = $this->taskQueue->dequeue(); + $onFinish(); + $taskRunner->next(); + } + } + + public function finished(): bool + { + return count($this->taskQueue) + count($this->currentTasks) <= 0; + } +} \ No newline at end of file diff --git a/src/Domain/Packaging/Execution/CommandBus/TaskRunner.php b/src/Domain/Packaging/Execution/CommandBus/TaskRunner.php new file mode 100644 index 0000000..af5dcde --- /dev/null +++ b/src/Domain/Packaging/Execution/CommandBus/TaskRunner.php @@ -0,0 +1,63 @@ +registry = $registry; + $this->current = null; + $this->task = $task; + $this->iterator = new \NoRewindIterator($task->getIterator()); + + $this->iterator->rewind(); + } + + public function next(): void + { + if ($this->current !== null) { + throw new \RuntimeException('A process is already running.'); + } + + if (!$this->iterator->valid()) { + throw new \RuntimeException('All tasks were consumed.'); + } + + $this->current = $this->iterator->current(); + $this->iterator->next(); + + $this->current->start(); + } + + public function isBusy(): bool + { + if ($this->current === null) { + throw new \RuntimeException('No process is running.'); + } + + if (!$this->current->isTerminated()) { + return true; + } + + if ($this->current->getExitCode() !== 0) { + throw new ProcessFailedException($this->current); + } + + $this->current = null; + return false; + } + + public function finished(): bool + { + return $this->iterator->valid(); + } +} \ No newline at end of file diff --git a/src/Domain/Packaging/Native/Flavor/ExperimentalFlavorRepository.php b/src/Domain/Packaging/Native/PHP/Flavor/ExperimentalFlavorRepository.php similarity index 71% rename from src/Domain/Packaging/Native/Flavor/ExperimentalFlavorRepository.php rename to src/Domain/Packaging/Native/PHP/Flavor/ExperimentalFlavorRepository.php index 7205ae2..47922ad 100644 --- a/src/Domain/Packaging/Native/Flavor/ExperimentalFlavorRepository.php +++ b/src/Domain/Packaging/Native/PHP/Flavor/ExperimentalFlavorRepository.php @@ -1,9 +1,6 @@ repository = $repository; @@ -45,7 +45,7 @@ public function getIterator() { /** @var Packaging\Context\BuildableContextInterface $context */ foreach ($this() as $context) { - yield new Native\Tag($this->repository, $context); + yield new Native\PHP\Tag($this->repository, $context); } } diff --git a/src/Domain/Packaging/Native/PackageVariation.php b/src/Domain/Packaging/Native/PHP/PackageVariation.php similarity index 85% rename from src/Domain/Packaging/Native/PackageVariation.php rename to src/Domain/Packaging/Native/PHP/PackageVariation.php index c9f23c8..12a6672 100644 --- a/src/Domain/Packaging/Native/PackageVariation.php +++ b/src/Domain/Packaging/Native/PHP/PackageVariation.php @@ -1,6 +1,6 @@ repository = $repository; @@ -52,7 +52,7 @@ public function getIterator() { /** @var Packaging\Context\BuildableContextInterface $context */ foreach ($this() as $context) { - yield new Native\TagVariation($this->repository, new TagReference($this->repository, $context), $context); + yield new Native\PHP\TagVariation($this->repository, new TagReference($this->repository, $context), $context); } } diff --git a/src/Domain/Packaging/Native/Tag.php b/src/Domain/Packaging/Native/PHP/Tag.php similarity index 97% rename from src/Domain/Packaging/Native/Tag.php rename to src/Domain/Packaging/Native/PHP/Tag.php index 77c5ec9..d021c63 100644 --- a/src/Domain/Packaging/Native/Tag.php +++ b/src/Domain/Packaging/Native/PHP/Tag.php @@ -1,6 +1,6 @@ repository = $repository; + $this->number = $number; + $this->path = $path; + $this->withExperimental = $withExperimental; + } + + public function __invoke(): \Traversable + { + yield new Packaging\Context\BuildableContext( + null, + $this->path, + [ + '%postgresql.version%' => $this->number, + ] + ); + } + + public function getIterator() + { + /** @var Packaging\Context\BuildableContextInterface $context */ + foreach ($this() as $context) { + yield new Native\PHP\Tag($this->repository, $context); + } + } + + public function pull(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + /** @var Packaging\Tag\TagBuildInterface $tag */ + foreach ($this as $tag) { + $tag->pull($task); + } + + return $task; + } + + public function push(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + /** @var Packaging\Tag\TagBuildInterface $tag */ + foreach ($this as $tag) { + $tag->push($task); + } + + return $task; + } + + public function build(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + /** @var Packaging\Tag\TagBuildInterface $tag */ + foreach ($this as $tag) { + $tag->build($task); + } + + return $task; + } + + public function forceBuild(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + /** @var Packaging\Tag\TagBuildInterface $tag */ + foreach ($this as $tag) { + $tag->forceBuild($task); + } + + return $task; + } +} \ No newline at end of file diff --git a/src/Domain/Packaging/Native/PostgreSQL/Tag.php b/src/Domain/Packaging/Native/PostgreSQL/Tag.php new file mode 100644 index 0000000..29f81f5 --- /dev/null +++ b/src/Domain/Packaging/Native/PostgreSQL/Tag.php @@ -0,0 +1,64 @@ +repository = $repository; + $this->name = new Packaging\Placeholder('%postgresql.version%', $context->getArrayCopy()); + $this->context = $context; + } + + public function getContext(): Packaging\Context\ContextInterface + { + return $this->context; + } + + public function __toString() + { + return (string) $this->name; + } + + public function getRepository(): Packaging\RepositoryInterface + { + return $this->repository; + } + + public function pull(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + $task->then(new Packaging\Execution\Command\Pull($this)); + + return $task; + } + + public function push(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + $task->then(new Packaging\Execution\Command\Push($this)); + + return $task; + } + + public function build(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + $task->then(new Packaging\Execution\Command\Build($this, $this->context)); + + return $task; + } + + public function forceBuild(Packaging\Execution\CommandBus\Task $task): Packaging\Execution\CommandBus\Task + { + $task->then(new Packaging\Execution\Command\ForceBuild($this, $this->context)); + + return $task; + } +} \ No newline at end of file diff --git a/src/Domain/Packaging/Platform/Package.php b/src/Domain/Packaging/Platform/Package.php index a5bb8ad..538116b 100644 --- a/src/Domain/Packaging/Platform/Package.php +++ b/src/Domain/Packaging/Platform/Package.php @@ -11,8 +11,8 @@ final class Package implements \IteratorAggregate, Packaging\PackageInterface, P private Packaging\RepositoryInterface $repository; public string $number; private Packaging\Placeholder $path; - private Native\Flavor\FlavorRepositoryInterface $flavors; - private Native\Variation\PackageVariationInterface $variations; + private Native\PHP\Flavor\FlavorRepositoryInterface $flavors; + private Native\PHP\Variation\PackageVariationInterface $variations; private Edition\EditionRepositoryInterface $editions; private bool $withExperimental; @@ -20,8 +20,8 @@ public function __construct( Packaging\RepositoryInterface $repository, string $number, Packaging\Placeholder $path, - Native\Flavor\FlavorRepositoryInterface $flavors, - Native\Variation\PackageVariationInterface $variations, + Native\PHP\Flavor\FlavorRepositoryInterface $flavors, + Native\PHP\Variation\PackageVariationInterface $variations, Edition\EditionRepositoryInterface $editions, bool $withExperimental = false ) { @@ -83,7 +83,7 @@ public function getIterator() /** @var Packaging\Context\BuildableContextInterface $context */ foreach ($this() as $context) { if (!$context->hasParent()) { - yield new Tag($this->repository, new Native\TagVariationReference($this->repository, $context), $context); + yield new Tag($this->repository, new Native\PHP\TagVariationReference($this->repository, $context), $context); } else { yield new Tag($this->repository, new TagReference($this->repository, $context->getParent()), $context); }