提交 44a917a2 编写于 作者: M Markus Pöschl

Move to plain alpine image to build pip dependencies successfully

上级 3ab59b83
......@@ -4,13 +4,18 @@
# https://github.com/nicolargo/glances
#
FROM python:3.9-alpine as build
FROM alpine:3.13 as build
RUN apk add --no-cache \
python3 \
python3-dev \
py3-pip \
py3-wheel \
musl-dev \
linux-headers \
build-base \
libzmq \
zeromq-dev \
curl \
lm-sensors \
wireless-tools \
......@@ -36,7 +41,7 @@ RUN CASS_DRIVER_NO_CYTHON=1 pip3 install --no-cache-dir --user -r optional-requi
FROM build as dev
COPY --from=additional-packages /root/.local/lib/python3.9/site-packages /usr/lib/python3.9/site-packages/
COPY --from=additional-packages /root/.local/lib/python3.8/site-packages /usr/lib/python3.8/site-packages/
COPY . /glances
# EXPOSE PORT (XMLRPC / WebUI)
......@@ -49,16 +54,17 @@ CMD python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT
#Create running images without any building dependency
FROM python:3.9-alpine as minimal
FROM alpine:3.13 as minimal
RUN apk add --no-cache \
python3 \
curl \
lm-sensors \
wireless-tools \
iputils
COPY --from=remoteInstall /root/.local/bin /usr/local/bin/
COPY --from=remoteInstall /root/.local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages/
COPY --from=remoteInstall /root/.local/lib/python3.8/site-packages /usr/lib/python3.8/site-packages/
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE 61209 61208
......@@ -69,4 +75,4 @@ CMD python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT
FROM minimal as full
COPY --from=additional-packages /root/.local/lib/python3.9/site-packages /usr/lib/python3.9/site-packages/
COPY --from=additional-packages /root/.local/lib/python3.8/site-packages /usr/local/python3.8/site-packages/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册