From 42d45c290436ee6ef51df60d5a7287c41b0c84c2 Mon Sep 17 00:00:00 2001 From: Nicolargo Date: Fri, 27 May 2016 13:28:51 +0200 Subject: [PATCH] Expose glances config file when running in docker #868 --- Dockerfile | 2 +- README.rst | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a772c2ce..c0566691 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,4 @@ EXPOSE 61209 EXPOSE 61208 # Define default command. -CMD python -m glances $GLANCES_OPT +CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT diff --git a/README.rst b/README.rst index 9f6b0e1f..3d34ab10 100644 --- a/README.rst +++ b/README.rst @@ -144,6 +144,22 @@ Run the container in console mode: docker run -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it docker.io/nicolargo/glances +Additionally, If you want to use your own glances.conf file, you can create your +own Dockerfile: + +.. code-block:: console + + FROM nicolargo/glances + COPY glances.conf /glances/conf/glances.conf + CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT + +Alternatively, you can specify something along the same lines with docker run options: + +.. code-block:: console + + docker run -v ./glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it docker.io/nicolargo/glances + +Where ./glances.conf is a local directory containing your glances.conf file. GNU/Linux ---------