[PYTHON] Expose your Docker image

I have been Docker for about a month, but I would like to introduce my own image of Docker Hub. For installation of Docker, please refer to Until you start Jupyter with Docker.

Everything is easy to do with Kitematic.

I will also explain the Dockerfile.

I'm using init.sh because it allows me to edit * .ipynb files on Windows, and it fails with direct CMD.

standard/Dockerfile


FROM tsutomu7/py3sci

RUN pip install ortoolpy
EXPOSE 8888
VOLUME ["/jupyter"]
WORKDIR /jupyter
COPY *.ipynb /root/tmp/
COPY data/ /root/tmp/data/
COPY init.sh /root/
CMD ["sh", "/root/init.sh"]

standard/init.sh


mv /root/tmp/* /jupyter
jupyter notebook --ip=* --no-browser

puzzle/Dockerfile


FROM debian:jessie

RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
    libglib2.0-0 libxext6 libsm6 libxrender1 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
ENV PATH /opt/conda/bin:$PATH
ENV LANG C.UTF-8
ENV MINICONDA Miniconda3-3.18.3-Linux-x86_64.sh
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
    wget --quiet https://repo.continuum.io/miniconda/$MINICONDA && \
    bash /$MINICONDA -b -p /opt/conda && \
    rm $MINICONDA && \
    conda install -y conda==3.18.3 && \
    conda update -y conda && \
    conda install -y jupyter && \
    pip install pulp unionfind && \
    rm -rf /opt/conda/pkgs/*
EXPOSE 8888
VOLUME ["/jupyter"]
WORKDIR /jupyter
COPY data /root/tmp/data/
COPY pic /root/tmp/pic/
COPY *.ipynb /root/tmp/
COPY init.sh /root/
CMD ["sh", "/root/init.sh"]

puzzle/init.sh


mv /root/tmp/* /jupyter
jupyter notebook --ip=* --no-browser

gotour/Dockerfile


FROM alpine

ENV GOPATH=/root/go
RUN apk add --update go git && \
    mkdir /root/go && \
    go get golang.org/x/tour/gotour && \
    apk del git && \
    rm /var/cache/apk/* 
EXPOSE 8080
CMD ["/root/go/bin/gotour", "-http", "0.0.0.0:8080"]

alpine-python3/Dockerfile


FROM alpine

ENV BLAS /usr/local/lib/libfblas.a
ENV LAPACK /usr/local/lib/liblapack.a
RUN apk add --update musl python3-dev freetype-dev make g++ gfortran wget && \
    cd /tmp && wget -q --no-check-certificate \
        https://raw.githubusercontent.com/catholabs/docker-alpine/master/blas.sh \
        https://raw.githubusercontent.com/catholabs/docker-alpine/master/blas.tgz \
        https://raw.githubusercontent.com/catholabs/docker-alpine/master/lapack.sh \
        https://raw.githubusercontent.com/catholabs/docker-alpine/master/lapack.tgz \
        https://raw.githubusercontent.com/catholabs/docker-alpine/master/make.inc \
        http://dl.ipafont.ipa.go.jp/IPAexfont/ipaexg00301.zip && \
    sh ./blas.sh && sh ./lapack.sh && \
    cp ~/src/BLAS/libfblas.a /usr/local/lib && \
    cp ~/src/lapack-3.5.0/liblapack.a /usr/local/lib && \
    pip3 install -U pip && \
    pip install numpy==1.9.3 && \
    pip install scipy matplotlib jupyter networkx pandas \
        scikit-learn blist bokeh statsmodels seaborn dask sympy && \
    unzip -q ipaexg00301.zip && \
    mv ipaexg00301/ipaexg.ttf /usr/lib/python3.4/site-packages/matplotlib/mpl-data/fonts/ttf/ && \
    rm -rf /var/cache/apk/* /tmp/* /root/src/
CMD ["sh"]

Recommended Posts

Expose your Docker image
Expose your .gitignore
Jupyter Docker image summary
Try using Jupyter's Docker image
Generate a Docker image using Fabric
Run TensorFlow Docker Image on Python3
Docker image that can use cx_Oracle
Try docker: Create your own container image for your Python web app
How to write Docker base image
Use cryptography library cryptography with Docker Python image
Dockerfile: Install Docker on your Linux server
[Golang] Create docker image with Github Actions