summaryrefslogtreecommitdiffstats
path: root/docker-files
diff options
context:
space:
mode:
authornicolargo <nicolashennion@gmail.com>2024-04-30 10:35:45 +0200
committernicolargo <nicolashennion@gmail.com>2024-04-30 10:35:45 +0200
commit88fee9bc8ed2882275b3363d9fcdfc260afbeb7a (patch)
treedfba01f8b62db9a777d36492f847cdc5b0243766 /docker-files
parentde69635d41efa38428e0779e2467632d2cafdede (diff)
Use buildx instead of build for local container images
Diffstat (limited to 'docker-files')
-rw-r--r--docker-files/alpine.Dockerfile5
-rw-r--r--docker-files/ubuntu.Dockerfile8
2 files changed, 11 insertions, 2 deletions
diff --git a/docker-files/alpine.Dockerfile b/docker-files/alpine.Dockerfile
index 14e23c13..d7a2dab1 100644
--- a/docker-files/alpine.Dockerfile
+++ b/docker-files/alpine.Dockerfile
@@ -67,6 +67,7 @@ COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-re
##############################################################################
# BUILD: Install the minimal image deps
FROM build as buildMinimal
+ARG PYTHON_VERSION
RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
@@ -76,6 +77,7 @@ RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --target="/venv/lib/p
##############################################################################
# BUILD: Install all the deps
FROM build as buildFull
+ARG PYTHON_VERSION
# Required for optional dependency cassandra-driver
ARG CASS_DRIVER_NO_CYTHON=1
@@ -91,10 +93,11 @@ RUN /venv-build/bin/python${PYTHON_VERSION} -m pip install --target="/venv/lib/p
##############################################################################
# Base image shared by all releases
FROM base as release
+ARG PYTHON_VERSION
# Copy source code and config file
COPY ./docker-compose/glances.conf /etc/glances/glances.conf
-COPY /glances /app/glances
+COPY ./glances/. /app/glances/
# Copy binary and update PATH
COPY docker-bin.sh /usr/local/bin/glances
diff --git a/docker-files/ubuntu.Dockerfile b/docker-files/ubuntu.Dockerfile
index 0fb38c4c..a44edbe2 100644
--- a/docker-files/ubuntu.Dockerfile
+++ b/docker-files/ubuntu.Dockerfile
@@ -60,6 +60,7 @@ COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-re
##############################################################################
# BUILD: Install the minimal image deps
FROM build as buildMinimal
+ARG PYTHON_VERSION
RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
@@ -69,6 +70,7 @@ RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-pack
##############################################################################
# BUILD: Install all the deps
FROM build as buildFull
+ARG PYTHON_VERSION
RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \
-r requirements.txt \
@@ -79,10 +81,11 @@ RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-pack
##############################################################################
# Base image shared by all releases
FROM base as release
+ARG PYTHON_VERSION
# Copy Glances source code and config file
COPY ./docker-compose/glances.conf /etc/glances/glances.conf
-COPY /glances /app/glances
+COPY ./glances/. /app/glances/
# Copy binary and update PATH
COPY docker-bin.sh /usr/local/bin/glances
@@ -99,12 +102,14 @@ CMD /venv/bin/python3 -m glances $GLANCES_OPT
################################################################################
# RELEASE: minimal
FROM release as minimal
+ARG PYTHON_VERSION
COPY --from=buildMinimal /venv /venv
################################################################################
# RELEASE: full
FROM release as full
+ARG PYTHON_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends libzmq5 \
@@ -116,6 +121,7 @@ COPY --from=buildFull /venv /venv
################################################################################
# RELEASE: dev - to be compatible with CI
FROM full as dev
+ARG PYTHON_VERSION
# Forward access and error logs to Docker's log collector
RUN ln -sf /dev/stdout /tmp/glances-root.log \