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