-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·37 lines (31 loc) · 1016 Bytes
/
build.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1016 Bytes
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
#!/bin/bash
set -e -x -o pipefail
baseimage="blitznote/debootstrap-amd64:16.04"
chost="x86_64-linux-gnu"
case $(dpkg --print-architecture) in
i386|i686)
baseimage="blitznote/debootstrap-i386:16.04"
chost="i386-linux-gnu"
;;
esac
docker pull "$baseimage"
WORKDIR="$(mktemp -t -d $(realpath --relative-to=.. .).XXXXXX)"
cp Dockerfile "$WORKDIR"/
cp -ra contrib "$WORKDIR"/
(cd "$WORKDIR"; \
sed -i \
-e "/^FROM/c\FROM $baseimage" \
-e "s#dl.hhvm.com#mirror.yourwebhoster.eu/hhvm#g" \
-e "s#https://#http://#g" \
-e "s:x86_64-linux-gnu:${chost}:g" \
Dockerfile && \
sed -i \
-e "/api.wordpress/s#http://#https://#" \
-e "/git clone/s#http://#https://#" \
Dockerfile && \
docker build --rm \
--build-arg=http_proxy=$(/usr/share/squid-deb-proxy-client/apt-avahi-discover) \
-t "local/wordpress-hhvm" .)
docker run --rm "local/wordpress-hhvm" dpkg-query -f '${Status}\t${Package}\t${Version}\n' -W \
| awk '/^install ok installed/{print $4,"\t",$5}' >build.manifest
rm -rf "$WORKDIR"