/
docker.json
56 lines (56 loc) 路 1.46 KB
/
docker.json
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
48
49
50
51
52
53
54
55
56
{
"variables": {
"anaconda_dir": "/opt/anaconda",
"anaconda_env": "default",
"cache": null,
"tag": null
},
"builders": [
{
"type": "docker",
"image": "nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04",
"commit": true,
"volumes": {
"{{pwd}}": "/env",
"{{user `cache`}}/install": "/install",
"{{user `cache`}}/pkgs": "{{user `anaconda_dir`}}/pkgs"
},
"changes": [
"ENV ANACONDA_DIR {{user `anaconda_dir`}}",
"ENV ANACONDA_ENV {{user `anaconda_env`}}",
"ENTRYPOINT [\"/entrypoint\"]",
"WORKDIR /src",
"ONBUILD COPY environment.yml ./",
"ONBUILD RUN {{user `anaconda_dir`}}/bin/conda env update --name={{user `anaconda_env`}}",
"ONBUILD COPY . ./"
]
}
],
"provisioners": [
{
"type": "shell",
"inline_shebang": "/bin/sh -eux",
"inline": [
"apt-get update -qq",
"apt-get install -y bzip2 curl g++",
"/install/anaconda.sh -b -u -p {{user `anaconda_dir`}}",
"{{user `anaconda_dir`}}/bin/conda env create --name={{user `anaconda_env`}} --file=/env/environment.yml",
"{{user `anaconda_dir`}}/bin/conda update -y -n base conda"
]
},
{
"type": "file",
"source": "entrypoint",
"destination": "/entrypoint"
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "{{user `tag`}}",
"tag": "latest"
}
]
]
}