-
Notifications
You must be signed in to change notification settings - Fork 13
/
bootstrap.sh
executable file
·35 lines (35 loc) · 1.29 KB
/
bootstrap.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
#!/bin/sh
set -e
if [ -z "$1" ]
then
echo "Usage: $0 username" >&2
exit 1
fi
username="$1"
git submodule update --init
docker rmi mwcampbell/muslbase-build-base || true
docker rmi $username/muslbase-build || true
for buildbase in debian selfhost selfhost
do
if [ "$buildbase" = "selfhost" ]
then
docker tag $username/muslbase mwcampbell/muslbase-build-base
else
docker build --rm -t=mwcampbell/muslbase-build-base buildbase/$buildbase
fi
docker rmi $username/muslbase || true
docker rmi $username/muslbase-runtime || true
docker rmi $username/muslbase-static-runtime || true
docker build --rm -t=$username/muslbase-build .
docker run --rm $username/muslbase-build cat /rootfs.tar > rootfs/full/rootfs.tar
docker build --rm -t=$username/muslbase rootfs/full
rm rootfs/full/rootfs.tar
docker run --rm $username/muslbase-build cat /runtime-rootfs.tar > rootfs/runtime/rootfs.tar
docker build --rm -t=$username/muslbase-runtime rootfs/runtime
rm rootfs/runtime/rootfs.tar
docker run --rm $username/muslbase-build cat /static-runtime-rootfs.tar > rootfs/static-runtime/rootfs.tar
docker build --rm -t=$username/muslbase-static-runtime rootfs/static-runtime
rm rootfs/static-runtime/rootfs.tar
docker rmi mwcampbell/muslbase-build-base
docker rmi $username/muslbase-build
done