miniconda3-docker hub



FROM ubuntu:14.04

MAINTAINER Dockerfiles

# Install required packages and remove the apt packages cache when done.

# install for miniconda
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
    libglib2.0-0 libxext6 libsm6 libxrender1 \
    libgtk2.0-0 \
    git mercurial subversion

RUN apt-get update && apt-get install -y \
    git \
    python-dev \
    python-setuptools \
    nginx \
    supervisor \
    sqlite3 \
        python-pip \
  && rm -rf /var/lib/apt/lists/*

# RUN easy_install pip
# python \

# install uwsgi now because it takes a little while
RUN pip install -U pip
RUN pip install uwsgi

RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/ && \
    wget --quiet -O ~/ && \
    /bin/bash ~/ -b -p /opt/conda && \
    rm ~/

RUN apt-get update && apt-get install -y curl grep sed dpkg && \
    TINI_VERSION=`curl | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
    curl -L "${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
    dpkg -i tini.deb && \
    rm tini.deb && \
    apt-get clean

# setup all the configfiles
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY nginx-app.conf /etc/nginx/sites-available/default
COPY supervisor-app.conf /etc/supervisor/conf.d/

# COPY requirements.txt and RUN pip install BEFORE adding the rest of your code, this will cause Docker's caching mechanism
# to prevent re-installinig (all your) dependencies when you made a change a line or two in your app.

COPY app/requirements.txt /home/docker/code/app/
RUN pip install -r /home/docker/code/app/requirements.txt

# add (the rest of) our code
COPY . /home/docker/code/

# install django, normally you would remove this step because your project would already
# be installed in the code/app/ directory
# RUN startproject website /home/docker/code/app/

# migrateしてみる。
RUN python /home/docker/code/app/ migrate

# collectstaticの指示
RUN python /home/docker/code/app/ collectstatic --noinput

ENV PATH /opt/conda/bin:$PATH

RUN conda install -y -c opencv3

CMD ["supervisord", "-n"]

これでbuild runしてみる。。。できた!cv2がimportできるかも確認しておく。

$ docker exec -it dd8d0b9444bc /bin/bash

/# python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2