File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ PHP Extensions:
3232Build the *** Docker Image*** without using *** cached*** versions of previous image build stages.
3333
3434``` bash
35- sudo docker build -f php-5-6-apache.Dockerfile --target php-5-6-build --no-cache -t php-5-6-web-server:latest .
35+ sudo docker build \
36+ -f php-5-6-apache.Dockerfile \
37+ --target php-5-6-build \
38+ --no-cache \
39+ -t php-5-6-web-server:latest \
40+ .
3641```
3742
3843** N.B.**
@@ -50,15 +55,26 @@ sudo docker build -f php-5-6-apache.Dockerfile --target php-5-6-build --no-cache
5055This creates a named container and attaches it to the *** host network*** and may cause port conflict if the host machine is already listening on any exposed ports from the *** Docker Image*** being used.
5156
5257``` bash
53- sudo docker run -d --network host -v " $( pwd) " /public_html:/var/www/html --name php-5-6-web-server php-5-6-web-server:latest
58+ sudo docker run \
59+ -d \
60+ --network host \
61+ -v " $( pwd) " /public_html:/var/www/html \
62+ --name php-5-6-web-server \
63+ php-5-6-web-server:latest
5464```
5565
5666** OR**
5767
5868This creates a named container and attaches it to the *** bridge network*** and allows for *** port forward mapping*** from the *** host*** to the *** Container*** .
5969
6070``` bash
61- sudo docker run -d --network bridge -p 8080:80/tcp -v " $( pwd) " /public_html:/var/www/html --name php-5-6-web-server php-5-6-web-server:latest
71+ sudo docker run \
72+ -d \
73+ --network bridge \
74+ -p 8080:80/tcp \
75+ -v " $( pwd) " /public_html:/var/www/html \
76+ --name php-5-6-web-server \
77+ php-5-6-web-server:latest
6278```
6379
6480** N.B.**
Original file line number Diff line number Diff line change @@ -4,15 +4,18 @@ FROM php:5.6-apache as php-5-6-build
44LABEL evilwizardcreations.image.authors="evil.wizard95@googlemail.com" \
55 evilwizardcreations.image.php.version="5.6"
66
7- # Enable some apache modules.
8- RUN a2enmod rewrite; \
9- a2enmod headers; \
10- a2enmod ssl
7+ # copy the specific Composer PHAR version from the Composer image into the PHP image
8+ COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
119
1210# Download the nodejs setup & set that it's a docker env.
1311ENV NODE_ENV docker
1412RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash
1513
14+ # Enable some apache modules.
15+ RUN a2enmod rewrite; \
16+ a2enmod headers; \
17+ a2enmod ssl
18+
1619# Install some extra stuff
1720RUN set -ex; \
1821 apt-get update; \
@@ -32,6 +35,3 @@ RUN set -ex; \
3235RUN docker-php-ext-install gettext mysqli pdo_mysql zip
3336RUN pecl install yaml-1.3.0 && \
3437 docker-php-ext-enable yaml
35-
36- # copy the specific Composer PHAR version from the Composer image into the PHP image
37- COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer
You can’t perform that action at this time.
0 commit comments