gpt4 book ai didi

docker - 如何在不使用 .dockerignore 的情况下跳过构建上下文的发送?

转载 作者:行者123 更新时间:2023-12-02 17:31:29 29 4
gpt4 key购买 nike

不使用 .dockerignore文件,有没有办法在通过以下命令构建图像时跳过构建上下文的发送?

docker build .

换句话说,我希望构建上下文为空,而无需手动创建一个空目录,然后将其传递给 docker build .

最佳答案

你可以跑

docker build - < Dockerfile

来自 official documentation :

This will read a Dockerfile from STDIN without context. Due to the lack of a context, no contents of any local directory will be sent to the Docker daemon.

关于docker - 如何在不使用 .dockerignore 的情况下跳过构建上下文的发送?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54666213/

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