diff options
Diffstat (limited to 'docker-files/ubuntu.Dockerfile')
-rw-r--r-- | docker-files/ubuntu.Dockerfile | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/docker-files/ubuntu.Dockerfile b/docker-files/ubuntu.Dockerfile index 4067d93d..a44edbe2 100644 --- a/docker-files/ubuntu.Dockerfile +++ b/docker-files/ubuntu.Dockerfile @@ -5,11 +5,11 @@ # # WARNING: the versions should be set. -# Ex: Python 3.10 for Ubuntu 22.04 +# Ex: Python 3.12 for Ubuntu 24.04 # Note: ENV is for future running containers. ARG for building your Docker image. -ARG IMAGE_VERSION=23.04 -ARG PYTHON_VERSION=3.11 +ARG IMAGE_VERSION=24.04 +ARG PYTHON_VERSION=3.12 ############################################################################## # Base layer to be used for building dependencies and the release images @@ -53,25 +53,27 @@ RUN apt-get install -y --no-install-recommends \ RUN apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN python${PYTHON_VERSION} -m venv --without-pip venv +RUN python3 -m venv --without-pip venv COPY requirements.txt docker-requirements.txt webui-requirements.txt optional-requirements.txt ./ ############################################################################## # BUILD: Install the minimal image deps FROM build as buildMinimal +ARG PYTHON_VERSION -RUN python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \ - # Note: requirements.txt is include by dep +RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \ + -r requirements.txt \ -r docker-requirements.txt \ -r webui-requirements.txt ############################################################################## # BUILD: Install all the deps FROM build as buildFull +ARG PYTHON_VERSION -RUN python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \ - # Note: requirements.txt is include by dep +RUN python3 -m pip install --target="/venv/lib/python${PYTHON_VERSION}/site-packages" \ + -r requirements.txt \ -r optional-requirements.txt ############################################################################## @@ -79,10 +81,11 @@ RUN python${PYTHON_VERSION} -m pip install --target="/venv/lib/python${PYTHON_VE ############################################################################## # 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 \ |