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
相关推荐
更深兼春远3 小时前
第2篇:Dify 部署保姆级教程:用 Docker跑起来
docker·容器·dify
小白的码BUG之路6 小时前
Docker -- No space left on device
运维·docker·容器
程序员老陆7 小时前
Docker 命令全景指南:从镜像构建到生产运维
运维·docker·容器
灯澜忆梦18 小时前
【minio】#1 | 简介与安装
docker·对象存储·minio
江湖有缘1 天前
3款开源绘图工具整理合集,可Docker一键部署!
docker·容器·开源
TTATTC1 天前
告别协议选型内耗:深入拆解微服务“内部 gRPC + 边界 REST”混合通信架构与 Envoy 转码实战
docker·开源
光依旧2 天前
PageIndex没翻车,翻车的是我的解析器
docker·langchain·大模型·向量数据库·pdf解析·rag·pageindex
谢亮_vipxieliang2 天前
容器排障实战手册:从日志到内核的分层排障
docker·云原生·容器·eureka
梦想不只是梦与想2 天前
Docker 常用命令
docker
小白的码BUG之路2 天前
Docker -- 构建ruoyi-gateway镜像
docker·容器·gateway