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
相关推荐
筱顾大牛2 小时前
使用docker部署到服务器
docker·部署
another heaven5 小时前
【Docker/虚拟机 深度对比Docker与虚拟机:原理、区别与最佳使用场景】
运维·docker·容器
独自归家的兔5 小时前
2026年4月16日 Ubuntu系统 Docker 的安装与配置
运维·docker·容器
舒一笑5 小时前
Docker 离线镜像导入后变成 <none>:<none>?一文讲透原因、排查与正确打包姿势
后端·docker·容器
Bonnienienie6 小时前
服务器Docker实例化容器 -- 踩坑大全
docker
殷紫川7 小时前
Docker Compose实战指南
运维·docker
鹅是开哥8 小时前
XXL-Job Docker 部署中“登录无响应”的排查与解决
运维·docker·容器
HYNuyoah11 小时前
3X-UI Reality 搭建指南
ubuntu·ui·docker
小夏子_riotous1 天前
Docker学习路径——3、常用命令
linux·运维·服务器·学习·docker·容器·centos
HYNuyoah1 天前
docker 安装win10系统
运维·docker·容器