-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-gpu
85 lines (63 loc) · 2.28 KB
/
Dockerfile-gpu
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM tensorflow/tensorflow:latest-devel-gpu-py3
MAINTAINER Anton Latukha <[email protected]>
## Set user-wide PATH Haskell Stack packages
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/root/.local/bin:"$PATH"
RUN apt update
## Install Stack with its dependencies
RUN curl -sSL https://get.haskellstack.org/ | sh
## IHaskell
### Install IHaskell system package dependencies
RUN apt install -y \
python3-pip git \
libtinfo-dev \
libzmq3-dev \
libcairo2-dev \
libpango1.0-dev \
libmagic-dev \
libblas-dev \
liblapack-dev
### Get IHaskell code, setup GHC, compile&install IHaskell Haskell dependencies, and then compile&install IHaskell itself
WORKDIR /root/IHaskell
RUN git clone --depth 1 https://github.com/gibiansky/IHaskell.git .
RUN pip3 install -r requirements.txt
RUN stack setup
RUN stack install --ghc-options=-O2 gtk2hs-buildtools
RUN stack install --ghc-options=-O2
## Tensorflow bindings
### Install system package dependencies (https://github.com/tensorflow/haskell)
RUN apt install -y \
libsnappy-dev \
libncurses5-dev \
libgmp-dev \
locales
### Install protobuf & libtensorlow-gpu
ENV PROTOBUF_V=3.3.0 \
LIBTFLOWGPU_V=1.0.0
RUN apt install -y unzip
RUN curl -O -L \
https://github.com/google/protobuf/releases/download/v"$PROTOBUF_V"/protoc-"$PROTOBUF_V"-linux-x86_64.zip && \
unzip -d /usr/local protoc-"$PROTOBUF_V"-linux-x86_64.zip bin/protoc && \
rm /usr/local protoc-"$PROTOBUF_V"-linux-x86_64.zip && \
chmod 755 /usr/local/bin/protoc && \
curl -L https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-"$LIBTFLOWGPU_V".tar.gz | tar -xz -C /usr/local && \
ldconfig
### Install Tensorflow Haskell dependencies and bindings itself
RUN stack install --ghc-options=-O2 \
snappy \
snappy-framing \
tensorflow-proto \
tensorflow \
tensorflow-core-ops \
tensorflow-ops \
tensorflow-records \
tensorflow-records-conduit \
tensorflow-test \
tensorflow-opgen \
tensorflow-logging
## Activate IHaskell Stack
RUN ihaskell install --stack
## Open port for Jupyter/IHaskell server
EXPOSE 8888
## Run Jupyter/IHaskell server
CMD stack exec jupyter -- notebook --allow-root