Class: Avmtrf1::Php::DockerImage
- Inherits:
-
Docker::Image
- Object
- Avm::Docker::Image
- Docker::Image
- Avmtrf1::Php::DockerImage
- Defined in:
- lib/avmtrf1/php/docker_image.rb
Constant Summary collapse
- MCRYPT_INSTALL_GREATER_EQUAL_7_2 =
<<~DOCKERFILE RUN pecl install mcrypt RUN echo extension=mcrypt.so > "$PHP_INI_DIR/conf.d/mcrypt.ini" DOCKERFILE
- MCRYPT_INSTALL_LESSER_7_2 =
<<~DOCKERFILE RUN docker-php-ext-install mcrypt DOCKERFILE
- XDEBUG_PECL_PACKAGE_LESSER_7 =
'xdebug-2.5.5'
- XDEBUG_PECL_PACKAGE_GREATER_EQUAL =
'xdebug'
Instance Attribute Summary collapse
-
#php_version ⇒ Object
readonly
Returns the value of attribute php_version.
Instance Method Summary collapse
-
#initialize(registry, php_version) ⇒ DockerImage
constructor
A new instance of DockerImage.
- #mcrypt_install ⇒ Object
- #stereotype_tag ⇒ Object
- #template_dir ⇒ Object
- #xdebug_pecl_package ⇒ Object
Methods inherited from Docker::Image
Constructor Details
#initialize(registry, php_version) ⇒ DockerImage
Returns a new instance of DockerImage.
26 27 28 29 |
# File 'lib/avmtrf1/php/docker_image.rb', line 26 def initialize(registry, php_version) super(registry) @php_version = php_version end |
Instance Attribute Details
#php_version ⇒ Object (readonly)
Returns the value of attribute php_version.
24 25 26 |
# File 'lib/avmtrf1/php/docker_image.rb', line 24 def php_version @php_version end |
Instance Method Details
#mcrypt_install ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/avmtrf1/php/docker_image.rb', line 39 def mcrypt_install if ::Gem::Version.new(php_version) >= ::Gem::Version.new('7.2') MCRYPT_INSTALL_GREATER_EQUAL_7_2 else MCRYPT_INSTALL_LESSER_7_2 end end |
#stereotype_tag ⇒ Object
31 32 33 |
# File 'lib/avmtrf1/php/docker_image.rb', line 31 def stereotype_tag "php-#{php_version}" end |
#template_dir ⇒ Object
35 36 37 |
# File 'lib/avmtrf1/php/docker_image.rb', line 35 def template_dir ::Avmtrf1.template('avmtrf1/php/docker_image') end |
#xdebug_pecl_package ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/avmtrf1/php/docker_image.rb', line 47 def xdebug_pecl_package if ::Gem::Version.new(php_version) < ::Gem::Version.new('7') XDEBUG_PECL_PACKAGE_LESSER_7 else XDEBUG_PECL_PACKAGE_GREATER_EQUAL end end |