Dockerfile -> Docker image -> Docker container

1. Dockfile -> Docker image

python 复制代码
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. 导入镜像

python 复制代码
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. 查看镜像是否导入成功

python 复制代码
docker images -a

4. 镜像制容器

python 复制代码
docker run -it -p 1212:221 --name shuai_docker shuai_image
相关推荐
AlfredZhao3 小时前
Docker 查看容器日志:别只记 `docker logs -f`
docker
初级炼丹师(爱说实话版)6 小时前
Ubuntu服务器配置docker
服务器·ubuntu·docker
生活爱好者!7 小时前
NAS还能用来开视频会议?docker一键部署MiroTalk SFU
运维·docker·容器
兵bing9 小时前
Docker Compose 进阶配置与最佳实践笔记
docker
是良辰9 小时前
Docker Nginx HTTPS 自签证书部署完整操作文档
nginx·docker·https
瞬间&永恒~10 小时前
【Docker】(四)Namespace 详解
运维·docker·容器
就改了10 小时前
Docker安装并运行Redis
redis·docker·容器
yagami_gagami12 小时前
第四届黄河流域公安院校电子物证个人赛服务器取证
linux·服务器·网络·mysql·安全·docker·llama
小挪号底迪滴12 小时前
Docker 多阶段构建实战:让 Python 镜像更小、更快、更安全
python·安全·docker
风曦Kisaki12 小时前
Kubernetes(K8s)笔记Day07: StatefulSet 有状态控制器详解与使用案例
linux·docker·云原生·容器·kubernetes