forked from alew3/faceit_live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
80 lines (62 loc) · 2.12 KB
/
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
76
77
78
79
80
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
ENV LANG C.UTF-8
###########
## Tools ##
###########
RUN apt-get update --fix-missing && apt-get install -y \
wget \
vim \
git \
unzip \
cmake \
imagemagick
# downgrade to cudnn 7.0 (tensorflow 1.5 binary doesn't work with 7.1)
RUN apt-get update && apt-get install -y --allow-change-held-packages --allow-downgrades --no-install-recommends \
bzip2 \
g++ \
git \
graphviz \
libgl1-mesa-glx \
libhdf5-dev \
openmpi-bin \
wget \
libcudnn7=7.0.5.15-1+cuda9.0 \
libcudnn7-dev=7.0.5.15-1+cuda9.0 \
&& \
rm -rf /var/lib/apt/lists/*
##############
## Anaconda ##
##############
RUN apt-get update --fix-missing && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh
ENV PATH /opt/conda/bin:$PATH
#########################
## faceswap_live dependencies ##
#########################
#RUN git clone --recurse-submodules https://github.com/alew3/faceit_live.git /code/faceit_live
WORKDIR /code/faceit_live
# Solves: `libjpeg.so.8: cannot open shared object file: No such file or directory`
# after `from PIL import Image`
RUN apt-get install -y libjpeg-turbo8
RUN echo export CUDA_DEVICE_ORDER="PCI_BUS_ID" >> ~/.bashrc
# https://software.intel.com/en-us/mkl
RUN /bin/bash -c "\
conda install -y mkl-service && \
conda install -y -c menpo ffmpeg"
RUN echo "export MKL_DYNAMIC=FALSE" >> ~/.bashrc
RUN python --version
RUN echo "installing python requirements"
COPY requirements.txt /code/
RUN /bin/bash -c "\
pip install --upgrade pip && \
pip install --ignore-installed -r /code/requirements.txt"
# edit ImageMagick policy /etc/ImageMagick-6/policy.xml
# comment out this line <policy domain="path" rights="none" pattern="@*" />
RUN sed -i s:'<policy domain="path" rights="none" pattern="@\*" />':'<!-- & -->':g /etc/ImageMagick-6/policy.xml