forked from hisplan/docker-cellranger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·43 lines (37 loc) · 1.25 KB
/
build.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
#!/bin/bash
source config.sh
# get download url for Cell Ranger
if [ ! -n "$download_url" ]
then
if [ ! -x "$(command -v scing)" ]
then
echo "Please install SCING CLI (https://github.com/hisplan/scing)."
exit 1
fi
out=`scing --no-logo download --site-url ${site_url}`
if [ $? != 0 ]
then
echo "$out"
exit 1
fi
download_url=$out
fi
# build ${image_name}:${version}
docker build \
--tag ${image_name}:${version} \
--build-arg DOWNLOAD_URL=${download_url} \
--build-arg VDJ_REFERENCE_VERSION=${vdj_ref_version} \
--build-arg CELLRANGER_VERSION=${version} .
# hack: comment the ENTRYPOINT and CMD lines to make it work for cromwell
# this will generate `Dockerfile.cromwell` and build it under the name `cromwell-${image_name}:${version}`
# https://github.com/broadinstitute/cromwell/issues/2461
cat Dockerfile \
| sed 's/^ENTRYPOINT \[/# ENTRYPOINT \[/g' \
| sed 's/^CMD \[/# CMD \[/g' > Dockerfile.cromwell
# build cromwell-${image_name}:${version}
docker build \
--tag cromwell-${image_name}:${version} \
--build-arg DOWNLOAD_URL=${download_url} \
--build-arg VDJ_REFERENCE_VERSION=${vdj_ref_version} \
--build-arg CELLRANGER_VERSION=${version} \
-f Dockerfile.cromwell .