mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-26 02:31:36 +03:00
Move to plain alpine image to build pip dependencies successfully
This commit is contained in:
parent
3ab59b833a
commit
44a917a2c6
@ -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/
|
||||
|
Loading…
Reference in New Issue
Block a user