/
build_docker.sh
executable file
·47 lines (32 loc) · 1.49 KB
/
build_docker.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
#!/bin/bash
#change directory to parent of this script so docker file can always be found without having to worry from which path you launch the script
APP_ROOT="$(dirname "$(dirname "$(readlink -fm "$0")")")"
cd $APP_ROOT
git clone git@github.com:rgcgithub/regenie.git
cd regenie
#optional
## uses master by default but omment out to use specific version
#git checkout c1daf24
## which htslib version to use for tabix etc.
HTSLIB_VER=1.14
## name to be appended to the resulting image name
FINNGEN_TAG=$1
### if this is given then does not rebuild regenie docker but uses this as base docker for building finngen docker
## leave empty or undefined to build regenie first.
BASE_REGENIE_DOCKER="eu.gcr.io/finngen-refinery-dev/regenie:3.3_r12"
TAG=$(cat VERSION)"_"$FINNGEN_TAG
if [[ -z "$BASE_REGENIE_DOCKER" ]]; then
IMG_NAME=regenie:v$(cat VERSION)".gz"
echo "Building base regenie version " $(cat VERSION)
make docker-build MKLROOT=1 STATIC=1 HAS_BOOST_IOSTREAM=1
else
echo "Skipping building base regenie and using $BASE_REGENIE_DOCKER"
IMG_NAME=$BASE_REGENIE_DOCKER
fi
cd ..
echo $PWD
echo "Building finngen regenie-pipeline docker based on $IMG_NAME and using htslib $HTSLIB_VER"
docker build -f docker/Dockerfile -t $IMG_NAME --build-arg base_image=$IMG_NAME --build-arg HTSLIB_VER=$HTSLIB_VER .
echo "Pushing to docker repo eu.gcr.io/finngen-refinery-dev/regenie:$TAG"
docker tag $IMG_NAME eu.gcr.io/finngen-refinery-dev/regenie:$TAG
docker push eu.gcr.io/finngen-refinery-dev/regenie:$TAG