forked from romeOz/docker-apache-php
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sh
99 lines (76 loc) · 2.18 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
set -e
echo "-- Building Apache + PHP 7.1 image"
docker build -t php-7.1 7.1/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-7.1; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 7.1'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-7.0
echo "-- Building Apache + PHP 7.0 image"
docker build -t php-7.0 7.0/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-7.0; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 7.0'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-7.0
echo
echo
echo "-- Building Apache + PHP 5.6 image"
docker build -t php-5.6 5.6/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-5.6; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 5.6'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-5.6
echo
echo
echo "-- Building Apache + PHP 5.5 image"
docker build -t php-5.5 5.5/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-5.5; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 5.5'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-5.5
echo
echo
echo "-- Building Apache + PHP 5.4 image"
docker build -t php-5.4 5.4/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-5.4; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 5.4'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-5.4
echo
echo
echo "-- Building Apache + PHP 5.3 image"
docker build -t php-5.3 5.3/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-5.3; sleep 5
curl 127.0.0.1:8080 2>/dev/null | grep -c 'Hello world'
docker exec -it app php -v | grep -c 'PHP 5.3'
echo
echo "-- Clear"
docker rm -f -v $(sudo docker ps -aq); sleep 5
docker rmi -f php-5.3