Stepping on the pit Dockerfile custom image reports an error "docker build" requires exactly 1 argument.

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!

 

Guess you like

Origin blog.csdn.net/weixin_43124425/article/details/108081616