Fernando Lozano
2019-06-11 a478662e00a38e2a1424381009c053b9787914d0
sources for custom image from chapter 01
2 files added
22 ■■■■■ changed files
php-hello-dockerfile/Dockerfile 19 ●●●●● patch | view | raw | blame | history
php-hello-dockerfile/index.php 3 ●●●●● patch | view | raw | blame | history
php-hello-dockerfile/Dockerfile
New file
@@ -0,0 +1,19 @@
FROM registry.access.redhat.com/ubi8/ubi
RUN yum --disableplugin=subscription-manager -y module enable php:7.2 \
  && yum --disableplugin=subscription-manager -y install httpd php \
  && yum --disableplugin=subscription-manager clean all
ADD index.php /var/www/html
RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \
  && mkdir /run/php-fpm \
  && chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \
  && chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm
EXPOSE 8080
USER 1001
CMD php-fpm & httpd -D FOREGROUND
php-hello-dockerfile/index.php
New file
@@ -0,0 +1,3 @@
<?php
print "Hello, World! PHP version is " . PHP_VERSION . "\n";
?>