构建容器时,有没有办法增加docker中的日志大小? [英] Is there a way to increase the log size in docker when building a container?

查看:908
本文介绍了构建容器时,有没有办法增加docker中的日志大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建时的输出中,我收到此消息:

In the output when building, I am getting this message:

[输出被裁剪,达到日志限制1MiB]

从命令

docker build --progress plain.

我目前的解决方法是将dockerfile中RUN命令的较大部分通过管道传递到/dev/null,即

The current workaround I have is to pipe larger sections of the RUN command in the dockerfile to /dev/null i.e.

RUN \
 echo "**** install packages ****" && \
 apt-get update && \
 apt-get install -y libcairo2-dev libjpeg-turbo8-dev libpng-dev libtool-bin libossp-uuid-dev wget maven default-jdk > /dev/null

推荐答案

通过@Luke Deluccia提供的密钥链接,这对我有用.

With the key link provided by @Luke Deluccia, this is what worked for me.

docker buildx create --use --name larger_log --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=50000000
docker buildx build --progress plain .

这将创建一个buildx实例,并将buildx设置为在构建时使用该实例.这并没有在构建过程中剪切日志.

This creates a buildx instance, and sets buildx to use the instance when building. This did not clip the logs during the build process.

这篇关于构建容器时,有没有办法增加docker中的日志大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆