gpt4 book ai didi

docker - 在Bluemix Containers上构建的Docker无法找到Dockerfile

转载 作者:行者123 更新时间:2023-12-02 18:41:59 26 4
gpt4 key购买 nike

我正在尝试使用以下命令使用Bluemix远程构建docker镜像:

cf ic build -t dude -f docker/production/Dockerfile .

但是我始终收到错误:
Sending build context to Docker daemon 32.57 MB
Error response from daemon: Build aborted with error: "filename 'Dockerfile' not found"

最初,将 Dockerfile移至项目的根目录似乎已挂起,但随后似乎成功了。

每个 documentation都支持docker build命令,因此我希望 -f选项也能正常工作。也许不是这样吗?

有什么想法或其他设法使它奏效的吗?以下是Docker版本信息:
# docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: darwin/amd64

Server:
Version: 3.0
API version: 1.20
Go version:
Git commit:
Built: 2016-02-10T16:22:49
OS/Arch: Bluemix Containers/

最佳答案

在阅读文档

https://console.ng.bluemix.net/docs/containers/container_cli_reference_cfic.html#container_cli_reference_cfic__build

我猜想的cf ic CLI不支持-f选项,但是IBM Bluemix Containers
无论如何,您都有机会在Bluemix上使用 docker native命令,如此处所述

https://console.ng.bluemix.net/docs/containers/container_cli_ov.html#container_cli_ov

Whenever possible, run docker commands as for example docker run During login, copy and paste the environment variables that are provided in the terminal. DOCKER_HOST sets the Docker host to IBM Containers. DOCKER_CERT_PATH sets the location of the authentication keys for the IBM Containers plug in for Cloud Foundry. DOCKER_TLS_VERIFY uses TLS and verifies the remote server. Then, you can use the Docker CLI directly for the current session to run supported Docker commands. Some exceptions require the use of cf ic commands to perform tasks specific to IBM Containers, such as setting a namespace.



据此,通过cf ic登录后,您可以将本地运行时docker引擎切换到Bluemix注册表(并返回),以设置的值。

DOCKER_HOST
(和DOCKER_CERT_PATH / DOCKER_TLS_VERIFY,但这些值不会更改)

设置为cf ic login的输出所建议的值(以及原始值以切换回本地环境)

关于docker - 在Bluemix Containers上构建的Docker无法找到Dockerfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35330223/

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