Skip to content

Commit c6cada5

Browse files
committed
updated readme
1 parent cf11503 commit c6cada5

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,50 @@ PHP Extensions:
3131

3232
Build the ***Docker Image*** without using ***cached*** versions of previous image build stages.
3333

34-
**N.B.**
35-
36-
This ***requires*** that the file be named `Dockerfile` and nothing else unless specified with the `-f php-5-6-apache.Dockerfile`.
37-
3834
```bash
3935
sudo docker build -f php-5-6-apache.Dockerfile --target php-5-6-build --no-cache -t php-5-6-web-server:latest .
4036
```
4137

38+
**N.B.**
39+
40+
- Using `-f php-5-6-apache.Dockerfile`
41+
42+
To specify the *filename* to ***build*** otherwise it is expected to be named `Dockerfile`.
43+
44+
- Using `--target php-5-6-build`
45+
46+
To select the ***build target stage***[^multi_stage_builds_note] from the *Dockerfile*.
47+
4248
### Create A Container
4349

4450
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.
4551

4652
```bash
47-
sudo docker run -d --network host -v "$(pwd)"/public_html:/var/www/html --name container-name php-5-6-web-server
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
4854
```
4955

5056
**OR**
5157

52-
This creates a named container and attaches it to the ***bridge network*** and allows for ***port forward mapping*** from the ***host*** to the ***Container***. The ports are mapped **8080** on the ***Host*** machine to port **80** on the ***Container***
58+
This creates a named container and attaches it to the ***bridge network*** and allows for ***port forward mapping*** from the ***host*** to the ***Container***.
5359

5460
```bash
55-
sudo docker run -d --network bridge -p 8080:80/tcp -v "$(pwd)"/public_html:/var/www/html --name container-name php-5-6-web-server
61+
sudo docker run -d --network bridge -p 8082:80/tcp -v "$(pwd)"/public_html:/var/www/html --name php-5-6-web-server php-5-6-web-server
5662
```
5763

64+
**N.B.**
65+
66+
- Using `-v "$(pwd)"/public_html:/var/www/html`
67+
68+
To ***Volume Mount*** the folder `public_html` from the current folder to `/var/www/html` on the ***running*** container. It is where ***Apache*** serves the content from & allows for *realtime* change updates.
69+
70+
- Using `-p 8080:80/tcp`
71+
72+
To map port **8080** on the ***Host*** machine to port **80** on the ***Container*** using the ***bridge network***.
73+
74+
- Using `--name php-5-6-web-server`
75+
76+
To name the ***Container*** being created.
77+
5878
### Start Container
5979

6080
```bash
@@ -95,4 +115,6 @@ sudo docker exec -it php-5-6-web-server /bin/bash
95115

96116
[^docker_pull_cmd_note]: Use `docker pull ewc2020/web:php-5.6-apache` to get a copy of the image.
97117

118+
[^multi_stage_builds_note]: Used mostly in ***Multi Stage*** image builds.
119+
98120
[^compose_name_note]: The `php-5-6-web-server` container name to build the image for.

0 commit comments

Comments
 (0)