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
相关推荐
仙柒4159 小时前
Docker存储原理
运维·docker·容器
快乐的哈士奇12 小时前
LangFuse 自托管实战:选型理由、Docker 部署与常用配置全解析
运维·人工智能·docker·容器
weixin_4492900114 小时前
Docker + MySQL 在 Windows 11 上的本地安装部署文档
mysql·docker·容器
Ysn071914 小时前
中文乱码:在 Docker 容器中设置中文语言环境
运维·python·docker·容器
zxd02031115 小时前
EFK(Elasticsearch + Fluentd + Kibana) 日志收集系统
运维·docker·jenkins
终端行者15 小时前
Jenkins Pipeline 企业级用法 参数化构建+Ansible发布---上
docker·ansible·jenkins·cicd
亚空间仓鼠16 小时前
Docker容器化高可用架构部署方案(十三)
docker·容器·架构
米高梅狮子17 小时前
01.mysql的备份与恢复
运维·数据库·mysql·docker·容器·kubernetes·github
console.log('npc')17 小时前
Windows 11 → WSL2 → Ubuntu → Docker → Codex → Sub2API
windows·ubuntu·docker