【问题标题】:docker: specifying a Dockerfile - "docker build" requires exactly 1 argument [duplicate]docker:指定一个 Dockerfile - “docker build” 需要 1 个参数 [重复]
【发布时间】:2021-01-28 15:18:39
【问题描述】:

文档说:

docker build [OPTIONS] PATH | URL | -

--file , -f     Name of the Dockerfile (Default is 'PATH/Dockerfile')

所以我正在使用

docker build -t <my tag> -f /path/to/my/Dockerfile>

但我明白了:

"docker build" requires exactly 1 argument.
See 'docker build --help'.

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

文档需要如何更正?

【问题讨论】:

标签: docker


【解决方案1】:

如 cmets 中所述,-f 不设置 Dockerfile 的路径,而是设置用作 Dockerfile 的文件的名称。你需要做类似的事情

docker build -t <tag> <path to the folder of the Dockerfile named X> -f X

如前所述,更多详细信息,here

【讨论】:

    猜你喜欢
    • 2021-02-06
    • 2015-05-13
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 2020-04-08
    • 2018-02-10
    • 2017-12-10
    • 1970-01-01
    相关资源
    最近更新 更多