-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtf.Dockerfile
75 lines (66 loc) · 2.89 KB
/
tf.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##############################################################################
## Base Image ##
##############################################################################
ARG TENSORFLOW_VERSION=2.11.0
FROM tensorflow/tensorflow:$TENSORFLOW_VERSION-gpu as tf-base
USER root
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
##############################################################################
## Rendering Dependencies ##
##############################################################################
FROM tf-base as tf-dependencies
USER root
RUN apt update \
&& apt install -y -qq --no-install-recommends \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libxext6 \
libx11-6 \
&& rm -rf /var/lib/apt/lists/*# Env vars for the nvidia-container-runtime.
RUN DEBIAN_FRONTEND=noninteractive \
apt update && \
apt install -y mesa-utils libgl1-mesa-glx libglu1-mesa-dev freeglut3-dev mesa-common-dev libopencv-dev python3-opencv python3-tk
RUN /usr/bin/python3 -m pip install --upgrade pip
##############################################################################
## User ##
##############################################################################
FROM tf-dependencies as tf-user
# install sudo
RUN apt-get update && apt-get install -y sudo
# Create user
ARG USER=jovyan
ARG PASSWORD=automaton
ARG UID=1000
ARG GID=1000
ENV USER=$USER
RUN groupadd -g $GID $USER \
&& useradd -m -u $UID -g $GID -p "$(openssl passwd -1 $PASSWORD)" \
--shell $(which bash) $USER -G sudo
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudogrp
USER $USER
RUN mkdir -p /home/$USER/workspace/src
RUN mkdir -p /home/$USER/data
WORKDIR /home/$USER/workspace/src
CMD ["bash"]
##############################################################################
## Manipulation Tasks ##
##############################################################################
FROM tf-user as dependencies
RUN pip install --no-cache-dir opencv-contrib-python
RUN pip install --no-cache-dir transforms3d tensorflow_addons
RUN pip install --no-cache-dir scipy numpy
RUN pip install --no-cache-dir scikit-learn einops
RUN pip install --no-cache-dir wandb pandas
RUN pip install --no-cache-dir imageio
RUN pip install --no-cache-dir msgpack colortrans
RUN pip install --no-cache-dir fastapi uvicorn
RUN pip install --no-cache-dir tensorflow-graphics
RUN pip install --no-cache-dir loguru
RUN pip install --no-cache-dir matplotlib
RUN pip install --no-cache-dir hydra-core --upgrade
RUN pip install --no-cache-dir httpx pydantic fastapi uvicorn msgpack
RUN pip install --no-cache-dir ftfy regex
ENV PYTHONPATH=/home/$USER/workspace/src/lib:$PYTHONPATH