Docker报错:“docker build“ requires exactly 1 argument.
·
报错
使用docker构建镜像时报错:
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker build -t test:latest
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
解决
复制粘贴时,小心细节,结尾一定要加空格再加点。
docker build -t test:latest .
[root@iZhp33j6fklnmhbf0lz2obZ ~]# docker build -t test:latest .
Sending build context to Docker daemon 28.76MB
Step 1/7 : FROM ubuntu:22.04
---> df5de72bdb3b
Step 2/7 : RUN apt-get update && apt-get install -y python3 python3-pip
---> Using cache
---> eee89b706a8b
Step 3/7 : RUN pip install flask==2.1.*
---> Using cache
---> d7b00194a3bd
Step 4/7 : COPY hello.py /
---> Using cache
---> eaf08a89e93f
Step 5/7 : ENV FLASK_APP=hello
---> Using cache
---> 981fa111d188
Step 6/7 : EXPOSE 8000
---> Using cache
---> a6ef7a1dc59d
Step 7/7 : CMD flask run --host 0.0.0.0 --port 8000
---> Using cache
---> 90cb9f03bf34
Successfully built 90cb9f03bf34
Successfully tagged test:latest
复制决定成败,细节决定人生。
更多推荐
已为社区贡献6条内容
所有评论(0)