From 2f1781f346757130e29ead946061db9730838d2e Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 20 May 2023 11:01:24 +0200 Subject: Add glances binary to '/usr/local/bin' + Update ENV PATH to include '/venv/bin' in Dockerfiles --- docker-bin.sh | 3 +++ docker-files/alpine.Dockerfile | 4 ++++ docker-files/ubuntu.Dockerfile | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 docker-bin.sh diff --git a/docker-bin.sh b/docker-bin.sh new file mode 100755 index 00000000..520e3e49 --- /dev/null +++ b/docker-bin.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/venv/bin/python3 -m glances $@ diff --git a/docker-files/alpine.Dockerfile b/docker-files/alpine.Dockerfile index 2497a438..81a22634 100644 --- a/docker-files/alpine.Dockerfile +++ b/docker-files/alpine.Dockerfile @@ -86,6 +86,10 @@ FROM base as release COPY ./docker-compose/glances.conf /etc/glances.conf COPY /glances /app/glances +# Copy binary and update PATH +COPY docker-bin.sh /usr/local/bin/glances +ENV PATH="$PATH:/venv/bin" + # EXPOSE PORT (XMLRPC / WebUI) EXPOSE 61209 61208 diff --git a/docker-files/ubuntu.Dockerfile b/docker-files/ubuntu.Dockerfile index 33771452..8447ba27 100644 --- a/docker-files/ubuntu.Dockerfile +++ b/docker-files/ubuntu.Dockerfile @@ -80,6 +80,10 @@ FROM base as release COPY ./docker-compose/glances.conf /etc/glances.conf COPY /glances /app/glances +# Copy binary and update PATH +COPY docker-bin.sh /usr/local/bin/glances +ENV PATH="$PATH:/venv/bin" + # EXPOSE PORT (XMLRPC / WebUI) EXPOSE 61209 61208 @@ -110,4 +114,4 @@ FROM full as dev # Forward access and error logs to Docker's log collector RUN ln -sf /dev/stdout /tmp/glances-root.log \ - && ln -sf /dev/stderr /var/log/error.log \ No newline at end of file + && ln -sf /dev/stderr /var/log/error.log -- cgit v1.2.3 From 4e102fd0bbdc3a09c985c7b47eb7131a6ea2cdf8 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 20 May 2023 11:13:08 +0200 Subject: Include docker binary file in .dockerignore --- .dockerignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.dockerignore b/.dockerignore index 7b9c92b8..21179a1d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,3 +15,6 @@ # Include Config file !/docker-compose/glances.conf + +# Include binary file +!/docker-bin.sh -- cgit v1.2.3 From 8a1e4d2c2cd39d93377ccd2bc27da0ed8f790a99 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 20 May 2023 11:20:34 +0200 Subject: typo --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 21179a1d..45e2da8a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,5 +16,5 @@ # Include Config file !/docker-compose/glances.conf -# Include binary file +# Include Binary file !/docker-bin.sh -- cgit v1.2.3 From 2413601560ae415b46873d6703387a6beb65a36d Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sat, 20 May 2023 11:25:40 +0200 Subject: Fix the PATH ENV var --- docker-files/alpine.Dockerfile | 2 +- docker-files/ubuntu.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-files/alpine.Dockerfile b/docker-files/alpine.Dockerfile index 81a22634..5ba23966 100644 --- a/docker-files/alpine.Dockerfile +++ b/docker-files/alpine.Dockerfile @@ -88,7 +88,7 @@ COPY /glances /app/glances # Copy binary and update PATH COPY docker-bin.sh /usr/local/bin/glances -ENV PATH="$PATH:/venv/bin" +ENV PATH="/venv/bin:$PATH" # EXPOSE PORT (XMLRPC / WebUI) EXPOSE 61209 61208 diff --git a/docker-files/ubuntu.Dockerfile b/docker-files/ubuntu.Dockerfile index 8447ba27..f719efed 100644 --- a/docker-files/ubuntu.Dockerfile +++ b/docker-files/ubuntu.Dockerfile @@ -82,7 +82,7 @@ COPY /glances /app/glances # Copy binary and update PATH COPY docker-bin.sh /usr/local/bin/glances -ENV PATH="$PATH:/venv/bin" +ENV PATH="/venv/bin:$PATH" # EXPOSE PORT (XMLRPC / WebUI) EXPOSE 61209 61208 -- cgit v1.2.3