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
相关推荐
杨浦老苏10 小时前
自托管网页EPUB阅读器Codexa
docker·群晖·电子书·calibre·opds
杨浦老苏11 小时前
开源文件协作平台OpenCloud
docker·文件管理·群晖·协作
weixin_3776348413 小时前
【MinerU】 Docker Compose 使用
docker·容器·mineru
庚昀◟14 小时前
腾讯云 CVM + Docker + Jenkins + GitLab CI/CD 全流程指南(python、flask实现简单计算器)
python·ci/cd·docker·flask·jenkins
SNOWPIAOP15 小时前
DOCKER的一些有用命令
docker
叶 落15 小时前
Ubuntu 通过 Docker 安装 Mysql8
linux·ubuntu·docker
赵文宇(温玉)15 小时前
Docker Compose 安装 Etcd
docker·容器·etcd
likeGhee15 小时前
docker创建nginx+keepalived+nacos集群(仅测试环境)
nginx·docker
ErizJ15 小时前
Docker | 学习笔记
笔记·学习·docker
绘梨衣5471 天前
Docker+FastAPI+MySQL 项目部署报错汇总
mysql·docker·fastapi