Search code examples
loggingdaemondocker

How do I not create docker container logs?


So my Hard drive space filled up today after starting up a container as a daemon:

sudo docker run -d --name nexpose-server nexpose

After I found the logs file of my container I realised that running my container had spawned a 177GB log file (all my free hard drive space).

I know this is not usual behaviour but the process in the container prints a lot of data to stdout. Most of the output is generated in the first 30 odd minutes as it updates itself initializes databases etc.

I would like to be able to either disable saving the logs or pipe the stdout to something like /dev/null. Is this possible? Has anyone got any better ideas?


Solution

  • Starting from Docker 1.6 you can use --log-driver=none when you run your container. See examples here: https://www.sumologic.com/2015/04/16/new-docker-logging-drivers/