• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • Buy SSL Certificates
  • Blog
  • OpenSSL
  • Keytool
  • SSL Tools
  • Donate

Docker log file size

May 16, 2022 by Mister PKI Leave a Comment

The purpose of this article is to explore the reasons why the docker log file size will increase and could potentially fill up your disk space in a short amount of time. If you have a host machine running Docker with log monitoring and/or log rotation in place, you may still fill up your disk space if you are not careful.

Docker stores a container log in the following directory location:

/var/lib/docker/containers/CONTAINER_ID/CONTAINER_ID-json.log

The log will continue to grow with output from standard out.

Max docker log file size

Docker run

To provide a max file size for this log you may append the following option to your docker run command:

--log-opt max-size=50m 

Where 50m is the size of the file, which should be set to the file size of your choice.

Docker compose

Alternatively, if you are using docker compose instead of the docker run command you can configure the max log file size for your docker container in the docker compose script.

logging:
      driver: "json-file"
      options:
        max-size: 50m

Where driver is the type of driver and max-size is the maximum file size of your docker log file.

Conclusion – Docker file log size

This article has demonstrated a couple of different methods for limiting the max size of log files generated by your docker containers. Let us know in the comments if you have any questions or would like to see more examples of how to reduce the size of your docker log files.

Read more of our articles on docker.

docker

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

Training Courses

Top online courses in IT & Software

Cyber Security Training

Udemy - The Complete Internet Security Privacy Course icon

Buy SSL Certificates

The SSL Store

Comodo Store

Sectigo Store

RapidSSL

Recent Posts

  • pfx password
  • pkcs12
  • Sendmail vs Postfix – Mail Transfer Agent Comparison
  • Python mock datetime now
  • Python get SSL Certificate

Footer

  • Twitter
  • YouTube

Pages

  • About Mister PKI
  • Blog
  • Compare and Buy Affordable PKI Certificates
  • Contact Us
  • Full Disclosure
  • Privacy Policy
  • SSL Tools – Certificate Decoder and Certificate Checker

Copyright © 2022