Skip to content

Commit fa562d8

Browse files
committed
expand on Docker commands to help developers
1 parent 40422a2 commit fa562d8

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you found this repo you are probably looking into Docker or already have know
1919

2020
---
2121

22-
#### Apache Web Server - Build Breakdown
22+
## Build Breakdown
2323

2424
```shell
2525
Apache # → Root of Docker Build
@@ -51,7 +51,9 @@ Launch the **Apache** instance locally and setup a local MySQL database containe
5151

5252
```bash
5353
$ git clone https://github.com/htmlgraphic/Apache.git && cd Apache
54-
$ make run
54+
$ make run
55+
OR (non Make Windows)
56+
$ docker-compose -f docker-compose.local.yml up -d
5557
```
5658

5759
---
@@ -72,3 +74,57 @@ These continuous integration services will fully test the creation of your conta
7274
---
7375

7476
**[Shippable](https://shippable.com)** - Test **production** and **dev** Docker builds, can the container be built the without error? The ```/tests/build_tests.sh``` file ensures the can run with parameters defined. Shippable allows the use of [matrix environment variables](http://docs.shippable.com/ci_configure/#using-environment-variables) reducing build time and offer a more robust tests. If any test(s) fail the system should be reviewed closer.
77+
78+
79+
## Interacting with containers:
80+
81+
View all running containers:
82+
83+
`docker ps`
84+
85+
View all containers (including stopped containers):
86+
87+
`docker ps -a`
88+
89+
Read the log of a running container:
90+
91+
`docker logs [container name or id]`
92+
93+
Follow the log of a running container:
94+
95+
`docker logs -f [container name or id]`
96+
97+
Read the Apache log:
98+
99+
`docker exec apache_web_1 cat ./data/apache2/logs/access_log`
100+
101+
Follow the Apache log:
102+
103+
`docker exec apache_web_1 tail -f ./data/apache2/logs/access_log`
104+
105+
Follow the outgoing mail log:
106+
107+
`docker exec apache_web_1 tail -f ./var/log/mail.log`
108+
109+
Gain terminal access to a running container:
110+
111+
`docker exec -it [container name or id] sh`
112+
113+
Restart a running container:
114+
115+
`docker restart [container name or id]`
116+
117+
Stop and start a container in separate operations:
118+
119+
`docker stop [container name or id]`
120+
121+
`docker start [container name or id]`
122+
123+
## Teardown
124+
#### (Stop all running containers started by Docker Compose):
125+
126+
```
127+
$ make rm
128+
OR (non Make Windows)
129+
$ docker rm -f apache_web_1 && docker rm -f apache_db_1
130+
```

0 commit comments

Comments
 (0)