Debian Codegraph @

docker/images/armabuild/Dockerfile.proto

raw
1 LABEL maintainer="Manuel Moos <[email protected]>"
2
3 # ###########################
4 # common ground
5 # ###########################
6
7 FROM base as commonground
8
9 # record libraries present in base system, install things we know we need
10 RUN ls /usr/lib/*.so* /usr/lib/x86_64-linux-gnu/*.so* /usr/lib/i386-linux-gnu/*.so* \
11 /lib/*.so* /lib/x86_64-linux-gnu/*.so* /lib/i386-linux-gnu/*.so* \
12 2>/dev/null | sed -e s,.*/,, > /usr/base_library_list && \
13 apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
14 curl \
15 g++ \
16 git \
17 make \
18 #libboost-dev \
19 #libboost-thread-dev \
20 #libprotobuf-dev \
21 #libxml2-dev \
22 libzthread-dev \
23 recode \
24 -y
25
26 # #####################################
27 # client and server build dependencies
28 # #####################################
29
30 FROM commonground as armabuild_base
31 # full build dependencies
32 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
33 desktop-file-utils \
34 file \
35 g++ \
36 git \
37 make \
38 libasound2-dev \
39 #libboost-dev \
40 #libboost-thread-dev \
41 libcurl4-openssl-dev \
42 # libssl-dev \
43 # libpsl-dev \
44 libfile-mimeinfo-perl \
45 #libfreetype6-dev \
46 #libftgl-dev \
47 libgl1-mesa-dev \
48 #libglew-dev \
49 libglu1-mesa-dev \
50 libjpeg-dev \
51 libpng-dev \
52 libpulse-dev \
53 #libprotobuf-dev \
54 #libsdl1.2-dev \
55 #libsdl-image1.2-dev \
56 #libsdl-mixer1.2-dev \
57 #libsdl2-dev \
58 #libsdl2-image-dev \
59 #libsdl2-mixer-dev \
60 #libxml2-dev \
61 libx11-dev \
62 #libxext-dev \
63 #libxt-dev \
64 #libxv-dev \
65 #x11proto-core-dev \
66 libzthread-dev \
67 pkg-config \
68 autoconf \
69 automake \
70 python3 \
71 recode \
72 pandoc \
73 #zlib1g-dev \
74 -y
75
76 # copy appimage tools
77 COPY appimage/* /usr/bin/
78
79 # optional (will fail for ancient steam builds)
80 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
81 appstream \
82 python3-packaging \
83 -y || true
84
85 FROM armabuild_base as armabuild
86
87 # for debugging, do the manual builds one at a time
88
89 # install our version of libxml2
90 #COPY build_libxml2.sh .
91 #RUN ./build_libxml2.sh libxml2-2.9.10 && rm ./build_libxml2.sh
92
93 # install our version of libsdl
94 #COPY libsdl-1.2.15-const-xdata32.patch build_libsdl.sh ./
95 #RUN ./build_libsdl.sh SDL-1.2.15 && rm ./build_libsdl.sh
96
97 # install our version of libsdl_image
98 #COPY build_libsdl_image.sh .
99 #RUN ./build_libsdl_image.sh SDL_image-1.2.12 && rm ./build_libsdl_image.sh
100
101 # install our version of libcurl
102 #COPY build_libcurl.sh .
103 #RUN ./build_libcurl.sh && rm ./build_libcurl.sh
104
105 ## for production: do all manual builds in one go, set up builder user
106 COPY build*.sh *.patch ./
107 RUN ./build_libxml2.sh libxml2-2.9.10 && rm ./build_libxml2.sh && \
108 ./build_libsdl.sh SDL-1.2.15 && rm ./build_libsdl.sh && \
109 ./build_libsdl_image.sh SDL_image-1.2.12 && rm ./build_libsdl_image.sh && \
110 ./build_libcurl.sh && rm ./build_libcurl.sh && \
111 useradd builder && mkdir -p /home/builder && chown builder:builder /home/builder # && chmod 777 /home/builder
112
113 # set up rest of builder user
114 #WORKDIR /home/builder
115 #USER builder
116
117 # test new dependencies here
118 # RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install X -y
119
120 # ###########################
121 # hack in zthread-config
122 # ###########################
123
124 # the source image here must match the steam one
125 FROM amd64/ubuntu:16.04 as zthreadsource
126 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install libzthread-dev -y
127
128 FROM armabuild_base as armabuild_zthreadconfig
129 COPY --from=zthreadsource /usr/bin/zthread-config /usr/bin/
130
131 FROM zthreaddest as armabuild_zthreadconfig_obsolete
132 # set up builder user
133 RUN useradd builder && mkdir -p /home/builder && chown builder:builder /home/builder # && chmod 777 /home/builder
134 WORKDIR /home/builder
135 USER builder
136
137 # ###########################
138 # debian build dependencies
139 # ###########################
140
141 FROM armabuild_base as armadeb_base
142 # more build dependencies
143 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
144 debhelper \
145 dh-systemd \
146 devscripts \
147 libsdl1.2-dev \
148 libsdl-image1.2-dev \
149 libsdl-mixer1.2-dev \
150 libxml2-dev \
151 lptools \
152 -y
153
154 FROM armadeb_base as armadeb
155 # set up builder user
156 #RUN useradd builder && mkdir -p /home/builder && chown builder:builder /home/builder # && chmod 777 /home/builder
157 #WORKDIR /home/builder
158 #USER builder
159
160 # ###########################
161 # bootstrap dependencies (ubuntu base)
162 # ###########################
163
164 FROM docker:19.03.0 as armaroot_alpine
165
166 RUN apk add \
167 autoconf \
168 automake \
169 bash \
170 #bison \
171 #boost-dev \
172 #boost-thread \
173 git \
174 g++ \
175 make \
176 libxml2-dev \
177 #protobuf-dev \
178 pkgconfig \
179 python3 \
180 py3-packaging \
181 tar \
182 recode \
183 zip \
184 --no-cache
185
186 # experimental new packages go here
187 # RUN apk add --no-cache pandoc
188
189 #FROM armaroot_alpine_base AS armaroot_alpine
190 # set up builder user
191 #RUN useradd builder; mkdir -p /home/builder; chown builder:builder /home/builder # && chmod 777 /home/builder
192 #WORKDIR /home/builder
193 #USER builder
194
195 # ###########################
196 # deploy dependencies
197 # ###########################
198
199 FROM armabuild_base as armadeploy_base
200 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
201 0install-core \
202 python3-launchpadlib \
203 lptools \
204 rsync \
205 -y
206
207 FROM armadeploy_base as armadeploy_nozero
208 # set up builder user
209 #RUN useradd builder && mkdir -p /home/builder && chown builder:builder /home/builder # && chmod 777 /home/builder
210 #WORKDIR /home/builder
211 #USER builder
212 # pre-load 0publish and feedlint
213 RUN export TERM=linux && \
214 git config --global push.default simple
215
216
217 FROM armadeploy_nozero as armadeploy
218 # pre-load 0publish and feedlint
219 RUN export TERM=linux && \
220 yes Y | 0launch -c 'https://apps.0install.net/0install/0publish.xml' --version && \
221 yes Y | 0launch -c 'https://apps.0install.net/0install/feedlint.xml' --version
222
223 # ###########################
224 # bootstrap dependencies (ubuntu base)
225 # ###########################
226
227 FROM commonground as bootstrap_ubuntu_base
228 RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
229 autoconf \
230 automake \
231 #bison \
232 g++ \
233 git \
234 make \
235 #libboost-dev \
236 #libboost-thread-dev \
237 #libprotobuf-dev \
238 #libxml2-dev \
239 libzthread-dev \
240 pkg-config \
241 python3 \
242 recode \
243 zip \
244 -y
245
246 #FROM bootstrap_ubuntu_base AS bootstrap_ubuntu
247 # set up builder user
248 #RUN useradd builder; mkdir -p /home/builder; chown builder:builder /home/builder # && chmod 777 /home/builder
249 #WORKDIR /home/builder
250 #USER builder
251
252 # ###########################
253 # docker dependencies (ubuntu base)
254 # ###########################
255
256 FROM bootstrap_ubuntu_base as armaroot_ubuntu_base
257
258 # prepare for repository
259 RUN apt-get -y update && \
260 DEBIAN_FRONTEND=noninteractive apt-get install \
261 apt-transport-https \
262 ca-certificates \
263 curl \
264 gnupg-agent \
265 software-properties-common \
266 -y
267
268 # set up repository
269 RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
270 apt-key fingerprint 0EBFCD88 | grep "9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88" && \
271 add-apt-repository \
272 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
273 $(lsb_release -cs) \
274 stable"
275
276 # install docker
277 RUN apt-get update -y && \
278 apt-get install -y docker-ce-cli
279
280 # full install would be
281 #RUN apt-get update -y && \
282 # DEBIAN_FRONTEND=noninteractive apt-get install -y docker-ce docker-ce-cli containerd.io
283
284 FROM armaroot_ubuntu_base AS armaroot_ubuntu
285 RUN mkdir -p /home/builder
286 WORKDIR /home/builder
287
288 # set up builder user, suid docker so we can actually use it
289 #RUN chmod u+s /usr/bin/docker && \
290 #RUN useradd builder && \
291 # mkdir -p /home/builder && \
292 # chown builder:builder /home/builder # && chmod 777 /home/builder
293 #WORKDIR /home/builder
294 #USER builder
295
296 # suid on docker is required because there is no safe way to
297 # bind-mound the docker control socket as usable by the builder user.
298 # so the only other way I can think of to make docker usable from
299 # inside the container is to keep everything in it running as root.
300