I want to create a docker image according to the tutorial.create docker image
1.vim wechat.Dockerfile
,paste all lines into the file.
ls -al wechat.Dockerfile
-rw-r--r-- 1 debian debian 1217 Apr 29 10:21 wechat.Dockerfile
2.Build docker image with commands:
docker build -f "wechat.Dockerfile" --tag=wechat:0.0.1
Info:
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
debian@debian:/tmp$ docker build -f wechat.Dockerfile --tag=wechat:0.0.1
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Add .
at the end of command:
docker build -f wechat.Dockerfile --tag=wechat:0.0.1 .
error checking context: 'can't stat '/tmp/systemd-private-ad10f6d540654f2791399efb421b6134-ModemManager.service-V2Upfj''.
No image 'wechat:0.0.1' created in current directory.
CodePudding user response:
The command given is actually
docker build -f wechat.Dockerfile --tag=wechat:0.0.1 .
The final period is important, and denotes the current directory.