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
相关推荐
普通网友4 小时前
《K8s 自动扩缩容:基于 CPU / 内存的 HPA 配置》
docker·容器·kubernetes
zfoo-framework9 小时前
docker compose安装gitea实现公司内部开发git私有仓库
docker·容器·gitea
无巧不成书021810 小时前
基于WSL 2的Docker远程开发全栈实战指南
运维·docker·容器·docker desktop·wsl 2·vs code远程开发·容器化开发
Renhao-Wan10 小时前
Docker 核心原理详解:镜像、容器、Namespace、Cgroups 与 UnionFS
java·后端·docker·容器
赵庆明老师10 小时前
Linux Docker打包
linux·运维·docker
Eloudy10 小时前
docker pull ubuntu:22.04 失败的解决记录
运维·docker·容器
taWSw5OjU11 小时前
Docker] Docker中`overlay2`磁盘占用爆满的清理方案
docker·容器·eureka
wwj888wwj1 天前
Docker基础(复习)
java·linux·运维·docker
DONG9991 天前
配置docker代理
docker·容器
怎么就重名了1 天前
docker可以动态修改端口映射吗
运维·docker·容器