Add glances binary to '/usr/local/bin' + Update ENV PATH to include '/venv/bin' in Dockerfiles

This commit is contained in:
Robin Candau 2023-05-20 11:01:24 +02:00
parent dc1c7a1ea0
commit 2f1781f346
3 changed files with 12 additions and 1 deletions

3
docker-bin.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/venv/bin/python3 -m glances $@

View File

@ -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

View File

@ -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
&& ln -sf /dev/stderr /var/log/error.log