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
相关推荐
Diligently_2 小时前
docker 中的常见的使用命令(三)
运维·docker·容器
csdn_aspnet15 小时前
如何使用 Docker 设置 PostgreSQL
运维·数据库·docker·postgresql·容器
赵文宇(温玉)18 小时前
Docker离线安装
运维·docker·容器
程序员agions1 天前
Docker Compose 生产环境配置记录
运维·docker·容器
AR-26710-2 天前
docker Day6——容器数据卷
运维·docker·容器
AR-26710-2 天前
docker Day5——改动+systemf复习
运维·docker·容器
csdn_aspnet3 天前
使用 Docker 配置 PostgreSQL 和 pgAdmin 4
数据库·docker·postgresql·pgadmin4
Maiko Star3 天前
Docker保姆级部署AI应用程序(FastAPI)
docker·容器·fastapi
`Levie4 天前
Docker-安装部署、容器管理(一)
docker·容器·eureka
Diligently_4 天前
第 08 篇|单机部署:本地安装与 Docker 最佳实践
运维·spring boot·docker