OS/Linux

alpine docker build

아르비스 2020. 11. 28. 17:50
FROM python:3.6.8-alpine

LABEL maintainer="David Yun <sncap7@gmail.com>" \
      name="Alpine Machine Learning Base Container" \
      description="Alpine for Machine Learning/Deep Learning stuffs with Python" \
      version="1.0"

RUN echo "|--> Updating" \
    && apk update && apk upgrade \
    && echo http://dl-cdn.alpinelinux.org/alpine/edge/main | tee /etc/apk/repositories \
    && echo http://dl-cdn.alpinelinux.org/alpine/edge/testing | tee -a /etc/apk/repositories \
    && echo http://dl-cdn.alpinelinux.org/alpine/edge/community | tee -a /etc/apk/repositories \
    && echo "|--> Install basics pre-requisites" \
    && pip3 install --upgrade pip \
    && pip install certifi --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org \
    && echo "|--> Install pip Lib"

RUN apk update
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install cython
RUN pip install numpy scipy pandas matplotlib

 

alpine docker에서는 pip 설치가 어려워 추가함.