God pit!
Customize the image through the dockerfile, and an error occurs when building the image
"docker build" requires exactly 1 argument.
Obviously, it is executed according to the tutorial, and the command is executed in the directory where the dockerfile is located ( note that this is an incorrect execution ):
$ docker build -t nginx:v3
In fact, it is not the case that the execution path is not specified during execution. correct execution
$ docker build -t nginx:v3 .
注意:这里的“.”表示在当前路径
实际上“.”指的是在指定上下文目录,docker build 命令会将该目录下的内容打包交给docker引擎以帮助构建镜像
Some tutorials are not noted, so it may be ignored and an error will be reported.
Finish!