18
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

alpineベースでpythonをdocker build

Posted at

はじめに

python3.5を想定しています。

alpineでpythonを使いたい

公式にあります
下記のようにすればOK。(90MB)

docker run -it python:3.5-alpine

alpineでpythonのnumpyを使いたい

下記のDockerfileでイメージを作ると、136MBですが、"conda install numpy scipy"でnumpyもscipyも簡単にインストールできます。

Dockerfile
FROM frolvlad/alpine-glibc

ENV PATH=/opt/conda/bin:$PATH \
    LANG=C.UTF-8 \
    MINICONDA=Miniconda3-latest-Linux-x86_64.sh
RUN apk add --no-cache bash wget && \
    wget -q --no-check-certificate https://repo.continuum.io/miniconda/$MINICONDA && \
    bash /Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && \
    ln -s /opt/conda/bin/* /usr/local/bin/ && \
    rm -rf /root/.[acpw]* /$MINICONDA /opt/conda/pkgs/*
CMD ["bash"]

科学技術計算用にtsutomu7/alpine-pythonをつくりました。(782MB)

Kitematicでしたら、"tsutomu7/alpine-python:jupyter" ならクリックで使えて便利です。

以上

18
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?