Pillow environment construction --For Docker + iPython (and OpenCV)

What do you want to do

--Put iPython on Docker so that you can use it anywhere --Image processing with Pillow --Image processing with OpenCV

Click here if you have a working environment → Image processing with Docker + iPython (settings) --Qiita --Qiita ")

I tried to find out what would happen if I made it with Docker, the virtualenv environment I made last time ... Someone has already done it.

Running IPython Notebook with Docker-Qiita

Yes. You've already written everything you need.

I have nothing to do.

The second decoction is not interesting, so I twisted it a little and made it Python 2.7 and added OpenCV. (It seems that Ubuntu's OpenCV does not support Python 3 yet) It is said that what they are doing is up to the original article ...

** This Docker environment is intended for use within a LAN. We prioritize convenience over security. Please be careful when executing on a server on the Internet. ** **

Create an image

docker build -t suto3/ipython-pillow:0.1 ./

Dockerfile


FROM ubuntu:14.04

MAINTAINER suto3 <[email protected]>

ENV DEBIAN_FRONTEND noninteractive

# Not essential, but wise to set the lang
# Note: Users with other languages should set this in their derivative image
RUN apt-get update && apt-get install -y language-pack-en language-pack-ja
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN locale-gen en_US.UTF-8
RUN dpkg-reconfigure locales

# Python binary dependencies, developer tools
RUN apt-get update && apt-get install -y -q \
    build-essential \
    make \
    gcc \
    gfortran \
    libfreetype6-dev \
    libxft-dev \
    libopenblas-dev \
    liblapack-dev \
    libzmq-dev \
    libcurl4-openssl-dev \
    zlib1g-dev \
    git \
    python \
    python-dev \
    python-pip \
    python-sphinx \
    python-mock \
    python-nose \
    python-jinja2 \
    python-tornado \
    python-zmq \
    python-numpy \
    python-matplotlib \
    python-pandas \
    python-scipy \
    python-jsonschema \
    python-requests \
    python-pygments \
    python-pymongo \
    sqlite3 \
    libsqlite3-dev \
    pandoc \
    libopencv-dev \
    python-opencv \
    nodejs \
    nodejs-legacy \
    npm \
    fonts-takao \
    fonts-ipafont \
    curl

RUN apt-get clean

# In order to build from source, need less
RUN npm install -g 'less@<3.0'

RUN pip install invoke
RUN pip install --upgrade \
    pillow \
    mock \
    nose \
    jinja2 \
    tornado \
    pyzmq \
    numpy \
    matplotlib \
    pandas \
    scipy \
    jsonschema \
    requests \
    mistune \
    pygments \
    pymongo \
    patsy \
    statsmodels \
    scikit-learn \
    ggplot \
    networkx \
    bokeh \
    sphinx \
    ipython

RUN iptest2

ENV HOME /root
RUN ipython profile create nbserver

# Install handy extension(s).
RUN ipython -c "%install_ext http://raw.github.com/jrjohansson/version_information/master/version_information.py"

# Configure "nbserver" profile
RUN sed -i \
    -e "s/^# c.NotebookApp.ip = 'localhost'$/c.NotebookApp.ip = '0.0.0.0'/" \
    -e "s/^# c.NotebookApp.port = 8888$/c.NotebookApp.port = 8888/" \
    -e "s;^# c.NotebookApp.notebook_dir = '/.*'$;c.NotebookApp.notebook_dir = '/notebook';" \
    -e "s/^# c.NotebookApp.open_browser = True$/c.NotebookApp.open_browser = False/" \
    -e "s/^# c.IPKernelApp.matplotlib = None$/c.IPKernelApp.matplotlib = 'inline'/" \
    -e "s/^# c.IPKernelApp.extensions = \[\]$/c.IPKernelApp.extensions = ['version_information']/" \
    /root/.ipython/profile_nbserver/ipython_notebook_config.py

# For IPython Notebook to share resources with other containers.
EXPOSE 8888
VOLUME ["/notebook"]

ENV LANG ja_JP.UTF-8
WORKDIR /notebook
# Use shell form to work with notebook.
CMD ipython notebook --profile=nbserver

Execution test part 1

docker run -d -p 8080:8888 suto3/ipython-pillow:0.1

Check if you can connect with the IP address of the host: 8080 /.

Execution test part 2

docker run -d -p 8080:8888  -v $PWD:/notebook suto3/ipython-pillow:0.1

The current directory is mounted on / notebook.

Upload to Docker Hub

docker login
docker push suto3/ipython-pillow:0.1

suto3/ipython-pillow Repository | Docker Hub Registry - Repositories of Docker Images

So I tried to raise it.

Try using

Image processing with Docker + iPython (settings) --Qiita

Image processing with Docker + iPython (Pillow edition) --Qiita

Image processing with Docker + iPython (OpenCV edition) --Qiita

Recommended Posts

Pillow environment construction --For Docker + iPython (and OpenCV)
Environment construction: GCP + Docker
Realize environment construction for "Deep Learning from scratch" with docker and Vagrant
Pillow environment construction --Virtual environment by virtualenv, interactive environment by iPython
Building a Docker working environment for R and Python
Pepper-kun remote control environment construction with Docker + IPython Notebook
Python environment construction For Mac
Docker + Django + React environment construction
Python environment construction and TensorFlow
NumPy and matplotlib environment construction
Ansible environment construction For Mac
From environment construction to deployment for flask + Heroku with Docker
Environment construction, simple confirmation and skill test for each language
[Linux] Docker environment construction on Redhat
Python3 TensorFlow for Mac environment construction
Image recognition environment construction and basics
Data science environment construction with Docker
[docker] python3.5 + numpy + matplotlib environment construction
OpenCV3 & Python3 environment construction on Ubuntu
Environment construction with pyenv and pyenv-virtualenv
Building a Docker working environment for R and Python 2: Japanese support
Build and try an OpenCV & Python environment in minutes using Docker
Prepare an environment to use OpenCV and Pillow with AWS Lambda
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Python project environment construction procedure (for windows)
Build Python3 and OpenCV environment on Ubuntu 18.04
Created Ubuntu, Python, OpenCV environment on Docker
Python and machine learning environment construction (macOS)
Construction of development environment for Choreonoid class
Environment construction for MXNet tutorial (gluon part)
Python3 TensorFlow environment construction (Mac and pyenv virtualenv)
Analytical environment construction with Docker (jupyter notebook + PostgreSQL)
Installation of Python3 and Flask [Environment construction summary]
[Django3] Environment construction and various settings summary [Python3]
Build PyPy and Python execution environment with Docker
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Python environment construction
Environment construction (python)
django environment construction
CodeIgniter environment construction
python environment construction
Python --Environment construction
Python environment construction
Golang environment construction
python environment construction
Word2vec environment construction
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
Clean install and work environment update for macOS Catalina
Allow Keras 2.0 and OpenCV 3.2 to work in GPU environment
From Kafka to KSQL --Easy environment construction with docker
Data analysis environment construction with Python (IPython notebook + Pandas)
WSL2 environment construction example Python, Node.js, Java, git-secrets, Docker
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Memorandum of understanding for environment construction of AutoML library PyCaret
[Introduction to RasPi4] Environment construction; OpenCV / Tensorflow, Japanese input ♪
Use Docker and Jupyter as execution environment distribution means for data analysis / visualization related workshops
Python environment construction and SQL execution example to DB and memo of basic processing for statistics 2019
Distributed environment construction with Raspberry PI series (7: tftp route setting and startup test for each Raspberry Pi)