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:
32
32
Build the *** Docker Image*** without using *** cached*** versions of previous image build stages.
33
33
34
34
``` 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
+ .
36
41
```
37
42
38
43
** N.B.**
@@ -50,15 +55,26 @@ sudo docker build -f php-5-6-apache.Dockerfile --target php-5-6-build --no-cache
50
55
This 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.
51
56
52
57
``` 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
54
64
```
55
65
56
66
** OR**
57
67
58
68
This creates a named container and attaches it to the *** bridge network*** and allows for *** port forward mapping*** from the *** host*** to the *** Container*** .
59
69
60
70
``` 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
62
78
```
63
79
64
80
** 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
4
4
LABEL evilwizardcreations.image.authors="evil.wizard95@googlemail.com" \
5
5
evilwizardcreations.image.php.version="5.6"
6
6
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
11
9
12
10
# Download the nodejs setup & set that it's a docker env.
13
11
ENV NODE_ENV docker
14
12
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash
15
13
14
+ # Enable some apache modules.
15
+ RUN a2enmod rewrite; \
16
+ a2enmod headers; \
17
+ a2enmod ssl
18
+
16
19
# Install some extra stuff
17
20
RUN set -ex; \
18
21
apt-get update; \
@@ -32,6 +35,3 @@ RUN set -ex; \
32
35
RUN docker-php-ext-install gettext mysqli pdo_mysql zip
33
36
RUN pecl install yaml-1.3.0 && \
34
37
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