为什么 docker 图像没有构建?

Why is the docker image not building?

我是按照官方网站上的教程来的。

https://docs.docker.com/get-started/part2/#build-the-app

我创建了一个名为 dir 的目录并添加了 Dockerfile、app.py 和 requirements.txt。当我尝试构建它时,错误是-

root@ubuntu:~/dir# docker build -t hello
"docker build" requires exactly 1 argument.
See 'docker build --help'.

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

Build an image from a Dockerfile

您忘记提及上下文根的位置

#>docker build -t hello .

添加一个。最后,如果 Dockerfile 位于当前位置