32

While Building my docker Image in Docker Desktop for windows,after some sort of time It throwing a error:

=> => # [output clipped, log limit 1MiB reached]

I tired configuring the log file size in daemon file and restarted the docker service

 "log-driver": "json-file",
 "log-opts": 
{
"max-size": "10m",
 "max-file": "3"
}

But still I'm getting the same error, Any one please advise me on this ?

veben
  • 19,637
  • 14
  • 60
  • 80
Debugger
  • 690
  • 1
  • 18
  • 41
  • Have you found the solution? – Nirmal Mar 12 '21 at 06:19
  • I'm facing the same issue. Have you found a solution? @Nirmal – wes Mar 17 '21 at 13:48
  • Same question was asked here - https://stackoverflow.com/questions/65819424/is-there-a-way-to-increase-the-log-size-in-docker-when-building-a-container – user08152017 May 13 '21 at 14:50
  • Does this answer your question? [Is there a way to increase the log size in docker when building a container?](https://stackoverflow.com/questions/65819424/is-there-a-way-to-increase-the-log-size-in-docker-when-building-a-container) – Brad Koch Jul 15 '21 at 11:35

3 Answers3

7

Per https://docs.docker.com/config/containers/logging/configure/ it suggests to:

Restart Docker for the changes to take effect for newly created containers. Existing containers do not use the new logging configuration.

Unfortunatelly docker build doesn't support --log-opt max-buffer-size=XXXm, but buildx does

As "the last shoot", you can remove --progress plain if you don't acutally need it

Noam Yizraeli
  • 4,446
  • 18
  • 35
CAMOBAP
  • 5,523
  • 8
  • 58
  • 93
2

You can use below one-line command when you use buildx:

docker buildx build . --builder "$(docker buildx create --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 --driver-opt env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000)"
Wilson Wu
  • 1,790
  • 19
  • 13
1

I encountered that happened because buildkit is enabled. So I disabled buildkit and it works fine for me:

"features": {
    "buildkit": false
}
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Duy Chung
  • 122
  • 7