Giter VIP home page Giter VIP logo

Comments (10)

oznu avatar oznu commented on August 19, 2024

It's probably the logs.

There are two things you can do. The first is to recreate the container with a log rule:

docker run <the rest of your config> --log-driver json-file --log-opt max-size=10m oznu/unms

This will keep the docker log size to less than 10MB.

The second is to clear the UNMS logs:

> /config/unms/logs/unms.log

You can run that command inside the container, or from the host if you replace /config with the path to your mapped volume. You could setup a cron to do this. Alternatively a logrotate policy would work too.

from docker-unms.

Snotmann avatar Snotmann commented on August 19, 2024

Ok I started the container with docker-compose and the yaml file for it.
The log was only 300 MB from 5 GB the docker folder was -.-

pi@snotberry:/var/lib $ sudo du -sh /var/lib/docker/
5.0G /var/lib/docker/

from docker-unms.

avluis avatar avluis commented on August 19, 2024

Where are the downloaded firmware images stored?
This could be the issue here -- is it possible to define/override the location of fw files?

from docker-unms.

mevatron avatar mevatron commented on August 19, 2024

I would recommend you run the container with QUIET_MODE = 1 as mentioned in Issue #4.

For example,

docker run -e QUIET_MODE=1 -d oznu/unms

If you need to clear a giant container log, do the following

docker ps -a

You should see something like this:

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                                                                                                                                                                                NAMES
1fd7bcbd5fa4        oznu/unms:latest             "/init"                  17 minutes ago      Up 17 minutes       0.0.0.0:10080->80/tcp, 0.0.0.0:10443->443/tcp

Note the CONTAINER ID, and become root

sudo su

# stop the unms container
docker stop 1fd7bcbd5fa4

Remove the container's json log file

rm /var/lib/docker/containers/1fd7bcbd5fa40f6ae79c403aa73eecc0ad410a52f78fbf92893fb96a944961f6/1fd7bcbd5fa40f6ae79c403aa73eecc0ad410a52f78fbf92893fb96a944961f6-json.log

Restart the container

docker start 1fd7bcbd5fa4

Hope that helps!

from docker-unms.

petekaik avatar petekaik commented on August 19, 2024

QUIET_MODE=1 solved heavy logging to docker container log but /config/unms/logs/unms.log kept growing rapidly. Let's see if logrotate can keep this file from growing too big. Link logrotate rule file as volume to container in docker-compose.yml like so
volumes: - ./config:/config - ./unms-logrotate:/etc/logrotate.d/unms-logrotate
And set contents of unms-logrotate to following
/config/unms/logs/*.log { size 10M copytruncate missingok rotate 7 compress delaycompress }

from docker-unms.

oznu avatar oznu commented on August 19, 2024

Thanks @petekaik.

I've added logrotate to the latest build using the config you posted. This should keep the internal log file under control.

from docker-unms.

petekaik avatar petekaik commented on August 19, 2024

I refreshed my container to your latest image and can see "unms" logrotate rule is now in place. Let's see if that takes care of controlling unms.log size.

from docker-unms.

petekaik avatar petekaik commented on August 19, 2024

Thanks @petekaik.

I've added logrotate to the latest build using the config you posted. This should keep the internal log file under control.

That 10M rule didn't seem to work afterall. I made another try with "daily" option and check if that cuts it.
/config/unms/logs/*.log { daily copytruncate missingok rotate 7 compress delaycompress }

Edit: That didn’t work either. May have to fall back to docker host cron triggering container logrotate.

Update: After few days testing this setup seems to work well enough. Not a 100% clean container solution (not exactly sure what best practice with containers and cron is) but now host crontab triggered container logrotate rotates unms.log and keeps filesizes under control (about 13M of log per day)
Host crontab:
58 23 * * * /path/to/your/host/docker exec unms sh -c 'logrotate -f /etc/logrotate.d/unms'

from docker-unms.

oznu avatar oznu commented on August 19, 2024

Thanks @petekaik.

from docker-unms.

Snotmann avatar Snotmann commented on August 19, 2024

So its not possible to deactivate the logging into unms.log ?

from docker-unms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.