forked from Akipe/android-aosp-build-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
176 lines (169 loc) · 8.29 KB
/
build.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/sh
set -o errexit
echo "Start building"
export BUILD_DATE_RFC3339=$(date --rfc-3339=date)
export BUILD_DATE=$(date -u +'%Y.%m.%d')
export BUILD_COMMIT_HASH=$(git rev-parse HEAD)
echo "*************************************"
echo "**** Building base system ********"
echo "*************************************"
echo "Building Archlinux base" && \
docker build \
--label "org.opencontainers.image.version=archlinux-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build-base:archlinux \
./images/archlinux && \
echo "Building Ubuntu 10.04 base" && \
docker build \
--file ./images/ubuntu/Dockerfile_10_04 \
--label "org.opencontainers.image.version=ubuntu-10.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build-base:ubuntu-10.04 \
./images/ubuntu && \
echo "Building Ubuntu 12.04 base" && \
docker build \
--file ./images/ubuntu/Dockerfile_12_04 \
--label "org.opencontainers.image.version=ubuntu-12.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build-base:ubuntu-12.04 \
./images/ubuntu && \
echo "Building Ubuntu 18.04 base" && \
docker build \
--file ./images/ubuntu/Dockerfile_18_04 \
--label "org.opencontainers.image.version=ubuntu-18.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build-base:ubuntu-18.04 \
./images/ubuntu && \
echo "Building Ubuntu 14.04 base" && \
docker build \
--file ./images/ubuntu/Dockerfile_14_04 \
--label "org.opencontainers.image.version=ubuntu-14.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build-base:ubuntu-14.04 \
./images/ubuntu
echo "*************************************"
echo "** Building for Android versions *"
echo "*************************************"
echo "Building Android 7.0 to 8.0 (Archlinux)" && \
docker build \
--file ./images/android/Dockerfile_7_8_archlinux \
--label "org.opencontainers.image.version=android-7-8-archlinux-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-7-archlinux \
--tag android-aosp-build:android-8-archlinux \
./images/android && \
echo "Building Android 9.0 to latest (Archlinux)" && \
docker build \
--file ./images/android/Dockerfile_9_latest_archlinux \
--label "org.opencontainers.image.version=android-9-latest-archlinux-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-9-archlinux \
--tag android-aosp-build:android-10-archlinux \
--tag android-aosp-build:android-11-archlinux \
--tag android-aosp-build:android-12-archlinux \
--tag android-aosp-build:android-13-archlinux \
./images/android && \
echo "Building Android 1.5 to 2.2.x (Ubuntu 10.04)" && \
docker build \
--file ./images/android/Dockerfile_1_2_ubuntu_10_04 \
--label "org.opencontainers.image.version=android-1.5-2.2-ubuntu-10.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-2.2 \
--tag android-aosp-build:android-2.2-ubuntu-10.04 \
--tag android-aosp-build:android-2.1 \
--tag android-aosp-build:android-2.1-ubuntu-10.04 \
--tag android-aosp-build:android-2.0 \
--tag android-aosp-build:android-2.0-ubuntu-10.04 \
--tag android-aosp-build:android-1.6 \
--tag android-aosp-build:android-1.6-ubuntu-10.04 \
--tag android-aosp-build:android-1.5 \
--tag android-aosp-build:android-1.5-ubuntu-10.04 \
./images/android && \
echo "Building Android 2.3.x to 4.4.x (Ubuntu 12.04)" && \
docker build \
--file ./images/android/Dockerfile_2_4_ubuntu_12_04 \
--label "org.opencontainers.image.version=android-2.3-4.4-ubuntu-12.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-4 \
--tag android-aosp-build:android-4-ubuntu-12.04 \
--tag android-aosp-build:android-2.3 \
--tag android-aosp-build:android-2.3-ubuntu-12.04 \
./images/android && \
echo "Building Android 5.0 (Ubuntu 12.04)" && \
docker build \
--file ./images/android/Dockerfile_5_ubuntu_12_04 \
--label "org.opencontainers.image.version=android-5-ubuntu-18.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-5 \
--tag android-aosp-build:android-5-ubuntu-12.04 \
./images/android && \
echo "Building Android 6.0 (Ubuntu 14.04)" && \
docker build \
--file ./images/android/Dockerfile_6_ubuntu_14_04 \
--label "org.opencontainers.image.version=android-6-ubuntu-14.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-6 \
--tag android-aosp-build:android-6-ubuntu-14.04 \
./images/android && \
echo "Building Android 7.0 to 8.0 (Ubuntu 18.04)" && \
docker build \
--file ./images/android/Dockerfile_7_8_ubuntu_18_04 \
--label "org.opencontainers.image.version=android-7-8-ubuntu-18.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-7-ubuntu-18.04 \
--tag android-aosp-build:android-8-ubuntu-18.04 \
./images/android && \
echo "Building Android 7.0 to 8.0 (Ubuntu 14.04)" && \
docker build \
--file ./images/android/Dockerfile_7_8_ubuntu_14_04 \
--label "org.opencontainers.image.version=android-7-8-ubuntu-14.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-7 \
--tag android-aosp-build:android-7-ubuntu-14.04 \
--tag android-aosp-build:android-8 \
--tag android-aosp-build:android-8-ubuntu-14.04 \
./images/android && \
echo "Building Android 9.0 to latest (Ubuntu 18.04)" && \
docker build \
--file ./images/android/Dockerfile_9_latest_ubuntu_18_04 \
--label "org.opencontainers.image.version=android-9-latest-ubuntu-18.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-9-ubuntu-18.04 \
--tag android-aosp-build:android-10-ubuntu-18.04 \
--tag android-aosp-build:android-11-ubuntu-18.04 \
--tag android-aosp-build:android-12-ubuntu-18.04 \
--tag android-aosp-build:android-13-ubuntu-18.04 \
./images/android && \
echo "Building Android 9.0 to latest (Ubuntu 14.04)" && \
docker build \
--file ./images/android/Dockerfile_9_latest_ubuntu_14_04 \
--label "org.opencontainers.image.version=android-9-latest-ubuntu-14.04-$BUILD_DATE" \
--label "org.opencontainers.image.revision=$BUILD_COMMIT_HASH" \
--label "org.opencontainers.image.created=$BUILD_DATE_RFC3339" \
--tag android-aosp-build:android-9 \
--tag android-aosp-build:android-9-ubuntu-14.04 \
--tag android-aosp-build:android-10 \
--tag android-aosp-build:android-10-ubuntu-14.04 \
--tag android-aosp-build:android-11 \
--tag android-aosp-build:android-11-ubuntu-14.04 \
--tag android-aosp-build:android-12 \
--tag android-aosp-build:android-12-ubuntu-14.04 \
--tag android-aosp-build:android-13 \
--tag android-aosp-build:android-13-ubuntu-14.04 \
--tag android-aosp-build:latest \
./images/android && \
echo "Building finished"