gpt4 book ai didi

windows - Docker 构建彩色消息不可读

转载 作者:行者123 更新时间:2023-12-04 04:31:09 24 4
gpt4 key购买 nike

我在 Windows 10 上使用“docker build”来构建 asp net core web 应用程序镜像。但是,自上次更新以来,消息的颜色变得不可读。在互联网上搜索没有提供任何答案。
关于如何解决这个问题的任何想法?
enter image description here

最佳答案

使用docker,你可以通过--help命令的选项以查看用法。例如。:

$ docker build --help

Usage: docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile

Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
--build-arg list Set build-time variables
--cache-from strings Images to consider as cache sources
--disable-content-trust Skip image verification (default true)
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
--iidfile string Write the image ID to the file
--isolation string Container isolation technology
--label list Set metadata for an image
--network string Set the networking mode for the RUN instructions during build (default "default")
--no-cache Do not use cache when building the image
-o, --output stringArray Output destination (format: type=local,dest=path)
--platform string Set platform if server is multi-platform capable
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
--pull Always attempt to pull a newer version of the image
-q, --quiet Suppress the build output and print image ID on success
--secret stringArray Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
--squash Squash newly built layers into a single new layer
--ssh stringArray SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
-t, --tag list Name and optionally a tag in the 'name:tag' format
--target string Set the target build stage to build.
要关闭彩色输出,您可以设置 --progress plain它删除了颜色格式的文本和其他 tty 功能,例如更新每个构建步骤的时间。
或者,您可能只想更改终端的颜色。黑色和白色都很好用。但是蓝色背景会与蓝色文本发生冲突。

另一种选择是禁用 buildkit 并恢复到经典构建引擎。这可以通过环境变量来完成:
export DOCKER_BUILDKIT=0
或在 /etc/docker/daemon.json 中配置默认​​值:
{
"features": {"buildkit": false }
}
然而,经典构建器将不支持添加到 buildkit 的功能,并且不太可能看到更多的发展。

关于windows - Docker 构建彩色消息不可读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66584350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com