nim-docker/build.sh

37 lines
770 B
Bash
Raw Normal View History

2018-11-13 18:39:20 +00:00
#!/bin/sh
2018-03-14 17:58:58 +00:00
set -ev
buildAndPush() {
docker build -t statusteam/$1 $1
2018-11-13 18:39:20 +00:00
# docker push statusteam/$1
2018-11-13 20:22:56 +00:00
rm $1/bootstrap.sh $1/qemu-*-static
2018-03-14 17:58:58 +00:00
}
2018-11-13 20:49:58 +00:00
buildAndPushArch() {
# Copy template to temporary dir, make substitutions and run docker build
BASE=$1
DIR=tmp-$BASE
TAG=nim-base:$BASE
ARCH=$2
mkdir -p $DIR
cp bootstrap.sh /usr/bin/qemu-$ARCH-static $DIR
cp Dockerfile.arch $DIR/Dockerfile
sed -i s/BASE/$BASE/ $DIR/Dockerfile
sed -i s/ARCH/$ARCH/ $DIR/Dockerfile
docker build -t statusteam/$TAG $DIR
# docker push statusteam/$TAG
rm -rf $DIR
}
2018-03-14 17:58:58 +00:00
if [ "$1" = "all" -o "$BUILD_ALL" = "true" ]
then
buildAndPush debian-pre-nim
fi
2018-11-13 19:47:19 +00:00
2018-11-13 18:39:20 +00:00
#buildAndPush nim-base
2018-11-13 20:49:58 +00:00
#buildAndPushArch arm32v7 arm
buildAndPushArch arm64v8 aarch64
2018-11-13 20:30:28 +00:00