-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile_tensorflow
More file actions
67 lines (52 loc) · 1.87 KB
/
Dockerfile_tensorflow
File metadata and controls
67 lines (52 loc) · 1.87 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
FROM tensorflow/tensorflow:2.4.1-gpu-jupyter
ENV LANG C.UTF-8
ARG APT_INSTALL="apt-get install -y --no-install-recommends"
ARG PIP_INSTALL="python -m pip --no-cache-dir install --user"
ARG GIT_CLONE="git clone --depth 10"
RUN rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update --fix-missing
# ==================================================================
# tools
# ------------------------------------------------------------------
RUN DEBIAN_FRONTEND=noninteractive ${APT_INSTALL} \
build-essential \
apt-utils \
libsm6 libxext6 libxrender-dev \
ca-certificates \
wget \
git \
vim \
libssl-dev \
curl \
unzip \
unrar \
ffmpeg \
strace \
&& \
${GIT_CLONE} https://github.com/Kitware/CMake ~/cmake && \
cd ~/cmake && \
./bootstrap && \
make -j"$(nproc)" install
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
RUN ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
# ==================================================================
# Add non-priviledged user
# ------------------------------------------------------------------
ARG UID=1000
RUN useradd -m -l -r -u $UID deep-dance -g sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER $UID
WORKDIR /home/deep-dance
ENV PATH="/home/deep-dance/.local/bin:${PATH}"
# ==================================================================
# copy requirements and install python packages
# ------------------------------------------------------------------
COPY tf_requirements.txt /home/deep-dance
RUN ${PIP_INSTALL} -r tf_requirements.txt