-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (49 loc) · 2.02 KB
/
Copy pathDockerfile
File metadata and controls
68 lines (49 loc) · 2.02 KB
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
FROM nvidia/cuda:10.1-cudnn7-devel as build-env
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
python-dev python-pip \
python3-dev python3-pip \
pkg-config \
zip unzip \
g++ \
zlib1g-dev \
git \
python3-setuptools python-setuptools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY ./requirements.txt ./requirements.txt
RUN pip3 install wheel && pip3 install -r requirements.txt
RUN curl -L https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-installer-linux-x86_64.sh \
-o bazel.sh && \
chmod +x bazel.sh && ./bazel.sh
COPY ./tensorflow ./tensorflow
ARG comp_cap=6.1
RUN cd tensorflow && \
echo "/usr/bin/python3\n\nn\n\n\ny\n\n$comp_cap\n\n\n\n\n\n" | ./configure && \
cat .tf_configure.bazelrc && \
bazel build --config=opt --config=cuda --config=noaws --config=nogcp --config=nohdfs --config=noignite --config=nokafka --config=nonccl //tensorflow/tools/pip_package:build_pip_package
RUN cd tensorflow && \
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \
pip3 install /tmp/tensorflow_pkg/tensorflow-1.15.0-cp36-cp36m-linux_x86_64.whl
FROM nvidia/cuda:10.1-cudnn7-devel
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
python-dev python-pip \
python3-dev python3-pip \
pkg-config \
zip unzip \
g++ \
zlib1g-dev \
git \
python3-setuptools python-setuptools \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY ./requirements.txt ./requirements.txt
RUN pip3 install wheel && pip3 install -r requirements.txt
RUN curl -L https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-installer-linux-x86_64.sh \
-o bazel.sh && \
chmod +x bazel.sh && ./bazel.sh
COPY --from=build-env /tmp/tensorflow_pkg/tensorflow-1.15.0-cp36-cp36m-linux_x86_64.whl /tmp/tensorflow_pkg/tensorflow-1.15.0-cp36-cp36m-linux_x86_64.whl
RUN pip3 install /tmp/tensorflow_pkg/tensorflow-1.15.0-cp36-cp36m-linux_x86_64.whl