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
相关推荐
方便面不加香菜12 小时前
Docker Compose 文件 -- docker-compose.yml
spring cloud·docker·容器
lambo mercy1 天前
04Docker_Container_容器
docker
Wellijohn1 天前
Docker 瘦身、手写 MCP、异步并发:被问得最多的 12 个问题,一次答完
python·docker·mcp
隔窗听雨眠1 天前
KWDB容器化部署的形态选择与参数细节
docker·时序数据库·kwdb
SeanQhl2 天前
openEuler 下 Docker 镜像操作与多阶段构建瘦身
docker·容器·镜像·openeuler·dockerfile
新*2 天前
ES 7.17 三节点 Docker 集群的自动备份:从 NFS 被拦住到用 ACL 根治权限
运维·elasticsearch·docker·slm·快照备份
Wellijohn2 天前
Docker 镜像从 1.2GB 压到 180MB:按这个顺序改,别一上来就 multistage
docker
AR-26710-2 天前
docker Day4——命令小结与实操作业
运维·docker·容器
AR-26710-3 天前
docker Day3——镜像,容器,日志与元数据
运维·docker·容器
duansamve3 天前
docker compose使用详解
docker