forked from tensorflow/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpu.Dockerfile
56 lines (45 loc) · 1.89 KB
/
gpu.Dockerfile
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
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
FROM nvidia/cuda:11.8.0-base-ubuntu20.04 as base
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8
COPY setup.sources.sh /setup.sources.sh
COPY setup.packages.sh /setup.packages.sh
COPY gpu.packages.txt /gpu.packages.txt
RUN /setup.sources.sh
RUN /setup.packages.sh /gpu.packages.txt
ARG PYTHON_VERSION=python3.8
ARG TENSORFLOW_PACKAGE=tf-nightly
COPY setup.python.sh /setup.python.sh
COPY gpu.requirements.txt /gpu.requirements.txt
RUN /setup.python.sh $PYTHON_VERSION /gpu.requirements.txt
RUN pip install --no-cache-dir ${TENSORFLOW_PACKAGE}
COPY setup.cuda.sh /setup.cuda.sh
RUN /setup.cuda.sh
COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
FROM base as jupyter
COPY jupyter.requirements.txt /jupyter.requirements.txt
COPY setup.jupyter.sh /setup.jupyter.sh
RUN python3 -m pip install --no-cache-dir -r /jupyter.requirements.txt -U
RUN /setup.jupyter.sh
COPY jupyter.readme.md /tf/tensorflow-tutorials/README.md
WORKDIR /tf
EXPOSE 8888
CMD ["bash", "-c", "source /etc/bash.bashrc && jupyter notebook --notebook-dir=/tf --ip 0.0.0.0 --no-browser --allow-root"]
FROM base as test
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH
COPY test.import_cpu.sh /test.import_cpu.sh
RUN /test.import_cpu.sh