2016-01-14 03:43:13 +08:00
|
|
|
# Note from Brandon on 2015-01-13:
|
|
|
|
#
|
|
|
|
# Always push this from an OSX Docker machine.
|
|
|
|
#
|
|
|
|
# If I build this on my Arch Linux desktop it works fine locally,
|
|
|
|
# but dlib gives an `Illegal Instruction (core dumped)` error in
|
|
|
|
# dlib.get_frontal_face_detector() when running on OSX in a Docker machine.
|
|
|
|
# Building in a Docker machine on OSX fixes this issue and the built
|
2016-01-14 05:10:58 +08:00
|
|
|
# container successfully deploys on my Arch Linux desktop.
|
2016-05-06 22:14:16 +08:00
|
|
|
#
|
|
|
|
# Building and pushing:
|
|
|
|
# docker build -f opencv-dlib-torch.Dockerfile -t opencv-dlib-torch .
|
|
|
|
# docker tag -f <tag of last container> bamos/ubuntu-opencv-dlib-torch:ubuntu_14.04-opencv_2.4.11-dlib_18.16-torch_2016.03.19
|
|
|
|
# docker push bamos/ubuntu-opencv-dlib-torch:ubuntu_14.04-opencv_2.4.11-dlib_18.16-torch_2016.03.19
|
2016-01-14 03:43:13 +08:00
|
|
|
|
2016-01-13 02:43:05 +08:00
|
|
|
FROM ubuntu:14.04
|
|
|
|
MAINTAINER Brandon Amos <brandon.amos.cs@gmail.com>
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
gfortran \
|
|
|
|
git \
|
2016-01-13 04:21:09 +08:00
|
|
|
graphicsmagick \
|
2016-03-20 11:03:07 +08:00
|
|
|
libgraphicsmagick1-dev \
|
2016-01-13 02:43:05 +08:00
|
|
|
libatlas-dev \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libboost-all-dev \
|
|
|
|
libgtk2.0-dev \
|
|
|
|
libjpeg-dev \
|
|
|
|
liblapack-dev \
|
|
|
|
libswscale-dev \
|
|
|
|
pkg-config \
|
|
|
|
python-dev \
|
|
|
|
python-numpy \
|
|
|
|
python-protobuf\
|
2016-03-20 04:10:59 +08:00
|
|
|
software-properties-common \
|
2016-01-13 02:43:05 +08:00
|
|
|
zip \
|
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
RUN curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash -e
|
|
|
|
RUN git clone https://github.com/torch/distro.git ~/torch --recursive
|
|
|
|
RUN cd ~/torch && ./install.sh && \
|
|
|
|
cd install/bin && \
|
|
|
|
./luarocks install nn && \
|
|
|
|
./luarocks install dpnn && \
|
|
|
|
./luarocks install image && \
|
|
|
|
./luarocks install optim && \
|
2016-01-13 06:57:59 +08:00
|
|
|
./luarocks install csvigo && \
|
|
|
|
./luarocks install torchx
|
2016-01-13 02:43:05 +08:00
|
|
|
|
|
|
|
RUN cd ~ && \
|
|
|
|
mkdir -p src && \
|
|
|
|
cd src && \
|
|
|
|
curl -L https://github.com/Itseez/opencv/archive/2.4.11.zip -o ocv.zip && \
|
|
|
|
unzip ocv.zip && \
|
|
|
|
cd opencv-2.4.11 && \
|
|
|
|
mkdir release && \
|
|
|
|
cd release && \
|
|
|
|
cmake -D CMAKE_BUILD_TYPE=RELEASE \
|
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr/local \
|
|
|
|
-D BUILD_PYTHON_SUPPORT=ON \
|
|
|
|
.. && \
|
|
|
|
make -j8 && \
|
|
|
|
make install
|
|
|
|
|
|
|
|
RUN cd ~ && \
|
|
|
|
mkdir -p src && \
|
|
|
|
cd src && \
|
|
|
|
curl -L \
|
|
|
|
https://github.com/davisking/dlib/releases/download/v18.16/dlib-18.16.tar.bz2 \
|
|
|
|
-o dlib.tar.bz2 && \
|
|
|
|
tar xf dlib.tar.bz2 && \
|
|
|
|
cd dlib-18.16/python_examples && \
|
|
|
|
mkdir build && \
|
|
|
|
cd build && \
|
|
|
|
cmake ../../tools/python && \
|
|
|
|
cmake --build . --config Release && \
|
|
|
|
cp dlib.so /usr/local/lib/python2.7/dist-packages
|