Skip to content

Commit a478662

Browse files
committed
sources for custom image from chapter 01
1 parent a387a34 commit a478662

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

php-hello-dockerfile/Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM registry.access.redhat.com/ubi8/ubi
2+
3+
RUN yum --disableplugin=subscription-manager -y module enable php:7.2 \
4+
&& yum --disableplugin=subscription-manager -y install httpd php \
5+
&& yum --disableplugin=subscription-manager clean all
6+
7+
ADD index.php /var/www/html
8+
9+
RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \
10+
&& mkdir /run/php-fpm \
11+
&& chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \
12+
&& chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm
13+
14+
EXPOSE 8080
15+
16+
USER 1001
17+
18+
CMD php-fpm & httpd -D FOREGROUND
19+

php-hello-dockerfile/index.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
print "Hello, World! PHP version is " . PHP_VERSION . "\n";
3+
?>

0 commit comments

Comments
 (0)