docker - 如何解决“docker build”只需要 1 个参数。错误?
问题描述
我正在尝试使用以下命令进行 docker build 并收到以下错误:
C:\>docker build --no-cache -t myrabbit -f dockerfile_rabbitmq
"docker build" requires exactly 1 argument.
See 'docker build --help'.Usage: docker build [OPTIONS] PATH | URL | -Build an image from a Dockerfile
我的 dockerfile:dockerfile_rabbitmq
已定义并存在于该目录中。我不完全确定为什么会收到此错误。任何帮助,将不胜感激!
解决方案
您忘记了.
docker build 命令末尾的 。
所以你的 docker build 命令应该是这样的
docker build --no-cache -t myrabbit -f Dockerfile .
推荐阅读
- python - 查找包含最多元素的列表
- android - 如何使下载的文件在 Android Q 的图库中可见?
- java - 在java中,我可以使用字符串拆分来按字符拆分吗?
- google-sheets - 使用 AND 和多个条件来格式化 google sheet/excel
- css - 适合父级的 Flex 盒子网格
- java - java列表的内存占用计算和GC计算
- python - 可变对象上的递归函数
- c# - 带有 Nuget 包的多个 Microsoft.Owin 版本
- php - 如何通过 MySql 查询结果中的循环输入表单(动态)发布 Ajax onClick
- amazon-web-services - 在 terraform 中创建 AWS 实例时如何使用 user_data url?