Dockerfile -> Docker image -> Docker container
1. Dockfile -> Docker image
docker build -t shuai_image -f xxx/xxx/Dockerfile . (.不能少)
出现:
[+] Building xxx(10/17)
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile:
…
=> => transferring context
=> CACHED
…
要等很久。。。。。。
2. 导入镜像
sudo docker load --input xxx/xxx/shuai_image.tar
65543534fewf2: Loading layer [>] 2.56k / 2.56k
123534fewf2: Loading layer [>] 2.56k / 2.56k
65543534fewf2: Loading layer [==================>] 2.56k / 2.56k
3. 查看镜像是否导入成功
docker images -a
4. 镜像制容器
docker run -it -p 1212:221 --name shuai_docker shuai_image
原文地址:https://blog.csdn.net/m0_51579041/article/details/145249420
免责声明:本站文章内容转载自网络资源,如侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!