Skip to content

Commit

Permalink
Non blocking error message when Glances starts from a container (alpi…
Browse files Browse the repository at this point in the history
…ne-dev image) #2991
  • Loading branch information
nicolargo committed Oct 26, 2024
1 parent ff1cde4 commit 34da616
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Include Config file
!/docker-compose/glances.conf
!/docker-files/docker-logger.json

# Include Binary file
!/docker-bin.sh
10 changes: 7 additions & 3 deletions docker-files/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ COPY --from=buildFull /venv /venv
# RELEASE: dev - to be compatible with CI
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
# Add the specific logger configuration file for Docker dev
# All logs will be forwarded to stdout
COPY ./docker-files/docker-logger.json /app
ENV LOG_CFG=/app/docker-logger.json

WORKDIR /app
CMD /venv/bin/python3 -m glances $GLANCES_OPT
10 changes: 7 additions & 3 deletions docker-files/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ COPY --from=buildFull /venv /venv
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 \
&& ln -sf /dev/stderr /var/log/error.log
# Add the specific logger configuration file for Docker dev
# All logs will be forwarded to stdout
COPY ./docker-files/docker-logger.json /app
ENV LOG_CFG=/app/docker-logger.json

WORKDIR /app
CMD /venv/bin/python3 -m glances $GLANCES_OPT

0 comments on commit 34da616

Please sign in to comment.