generated from PeerHerholz/python_package_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_images.sh
37 lines (30 loc) · 1.05 KB
/
generate_images.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
#Generate Dockerfile.
#!/bin/sh
set -e
generate_docker() {
docker run --rm kaczmarj/neurodocker:0.7.0 generate docker \
--base BaseImage \
--pkg-manager apt \
--arg DEBIAN_FRONTEND=noninteractive \
--miniconda \
version=latest \
conda_install="python=PythonVersion PythonPackages" \
pip_install="PythonPackages" \
create_env='package_name' \
activate=true \
--copy . /home/package_name \
--run-bash "source activate package_name && cd /home/package_name && pip install -e ." \
--env IS_DOCKER=1 \
--workdir '/tmp/' \
--entrypoint "/neurodocker/startup.sh package_name"
}
# generate files
generate_docker > Dockerfile
# check if images should be build locally or not
if [ $1 = local ]; then
echo "docker image will be build locally"
# build image using the saved files
docker build -t package_name:local .
else
echo "Image(s) won't be build locally."
fi