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
相关推荐
engchina2 小时前
WSL Ubuntu で Kubernetes v1.34.2 + Docker 環境を構築する
ubuntu·docker·kubernetes
oMcLin6 小时前
2025年必备的Docker命令指南与实战示例
docker·容器·eureka
AtoposのCX3306 小时前
Docker运行hello-world镜像失败或超时
运维·docker
sun cat6 小时前
Docker详细介绍(6)
docker·容器·docker-compose
小Pawn爷10 小时前
4.镜像仓库
docker
江湖有缘12 小时前
零基础入门:使用 Docker 快速部署 Organizr 个人主页
java·服务器·docker
礼拜天没时间.14 小时前
深入Docker架构——C/S模式解析
linux·docker·容器·架构·centos
猫头虎14 小时前
如何使用Docker部署OpenClaw汉化中文版?
运维·人工智能·docker·容器·langchain·开源·aigc
会周易的程序员14 小时前
openplc runtimev4 Docker 部署
运维·c++·物联网·docker·容器·软件工程·iot
小Pawn爷15 小时前
1.Docker基础
运维·docker·容器