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
相关推荐
敲上瘾17 小时前
Docker 存储卷(Volume)核心概念、类型与操作指南
linux·服务器·数据库·docker·容器·架构
IT利刃出鞘18 小时前
Docker--宿主机和容器相互拷贝文件
运维·docker·容器
慕容晓开1 天前
docker,本地目录挂载
docker
Mr. Cao code1 天前
Docker:颠覆传统虚拟化的轻量级革命
linux·运维·ubuntu·docker·容器
Dontla1 天前
Docker多共享网络配置策略(Docker多网络、Docker networks、Docker Compose网络、Docker网络、Docker共享网络)
网络·docker·容器
Jayin_chan1 天前
paddlex3.0.1-ocr服务化安装部署(docker)
docker·容器·ocr
ifanatic1 天前
[每周一更]-(第159期):Go 工程师视角:容器化技术(Docker/Kubernetes)与CI/CD流程的应用场景
docker·golang·kubernetes
感哥1 天前
Docker镜像
docker
Dontla1 天前
Dockerfile解析器指令(Parser Directive)指定语法版本,如:# syntax=docker/dockerfile:1
java·docker·eureka
楠神说软件测试1 天前
Docker命令(全)
docker