-
Notifications
You must be signed in to change notification settings - Fork 121
/
test.sh
executable file
·130 lines (100 loc) · 2.75 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
set -e
echo "-- Building Apache + PHP 7.3 image"
docker build -t php-7.3 7.3/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-7.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 7.3'
echo
echo "-- Clear"
docker rm -f -v app; sleep 5
docker rmi -f php-7.3
echo "-- Building Apache + PHP 7.2 image"
docker build -t php-7.2 7.2/
echo
echo "-- Testing server is running"
docker run --name app -d -p 8080:80 php-7.2; 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.2'
echo
echo "-- Clear"
docker rm -f -v app; sleep 5
docker rmi -f php-7.2
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 app; sleep 5
docker rmi -f php-7.1
echo
echo
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 app; 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 app; 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 app; 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 app; 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 app; sleep 5
docker rmi -f php-5.3