summaryrefslogtreecommitdiffstats
path: root/docker-files
diff options
context:
space:
mode:
authorEduard Marbach <mail@eduard-marbach.de>2020-11-04 17:36:00 +0100
committerEduard Marbach <mail@eduard-marbach.de>2020-12-28 16:47:12 +0100
commit28f11439769f3402b8feff2830dfef8c700cbd9c (patch)
tree35e6842766921a758a2d1ac0264c6ea6b5a5bc74 /docker-files
parent228818ee55996e30afaa7dd3b4397c56139fc802 (diff)
fix: dev build contains all optional req
- requires base image to be full fledged python -> results in bigger image size for dev.
Diffstat (limited to 'docker-files')
-rw-r--r--docker-files/Dockerfile25
-rw-r--r--docker-files/dev.Dockerfile37
2 files changed, 45 insertions, 17 deletions
diff --git a/docker-files/Dockerfile b/docker-files/Dockerfile
index b5eaeb2d..2a169c92 100644
--- a/docker-files/Dockerfile
+++ b/docker-files/Dockerfile
@@ -13,25 +13,16 @@ ENV DEBIAN_FRONTEND noninteractive
RUN \
apt-get update && \
apt-get install -y \
- curl \
- gcc \
- lm-sensors \
- wireless-tools \
- iputils-ping && \
+ curl \
+ gcc \
+ lm-sensors \
+ wireless-tools \
+ iputils-ping && \
rm -rf /var/lib/apt/lists/*
-ARG VERSION
-## Install glances
-## If version is dev will use git checkout
-RUN if [ "$VERSION" = "dev" ] ; then \
- echo Installing dev branch of glances from git; \
- apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* ; \
- pip3 install psutil bottle ; \
- git clone -b develop https://github.com/nicolargo/glances.git ; \
- else \
- echo Installing glances from pip; \
- pip3 install glances[all]; \
- fi
+# Force rebuild otherwise it could be cached without rerun
+ARG VCS_REF
+RUN pip install glances[all]
# Define working directory.
WORKDIR /glances
diff --git a/docker-files/dev.Dockerfile b/docker-files/dev.Dockerfile
new file mode 100644
index 00000000..21bdc2a0
--- /dev/null
+++ b/docker-files/dev.Dockerfile
@@ -0,0 +1,37 @@
+#
+# Glances Dockerfile (based on Ubuntu)
+#
+# https://github.com/nicolargo/glances
+#
+
+ARG ARCH=
+FROM ${ARCH}python:3-buster
+
+# Install package
+# Must used calibre package to be able to run external module
+ENV DEBIAN_FRONTEND noninteractive
+RUN \
+ apt-get update && \
+ apt-get install -y \
+ curl \
+ gcc \
+ git \
+ lm-sensors \
+ wireless-tools \
+ iputils-ping && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN pip install psutil bottle
+
+COPY . /glances
+
+# Define working directory
+WORKDIR /glances
+
+RUN CASS_DRIVER_NO_CYTHON=1 pip install -r optional-requirements.txt
+
+# EXPOSE PORT (XMLRPC / WebUI)
+EXPOSE 61209 61208
+
+# Define default command.
+CMD python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT