Docker layered download understanding and docker submit its own image
1. Docker layered download understanding
All docker images originate from a basic image. When the image is modified or new content is added, a new image layer will be created on top of the current image layer.
The following example:
as shown in the figure, the tomcat image has 10 layers.
2. Docker submits its own image
1. Download an official tomcat mirror
Code:
docker pull tomcat
Screenshot:
2. Start the image in the background
Code:
docker run -d --name tomcat -p 8003:8080 tomcat
Screenshot:
3. Enter the container
Code:
docker exec -it tomcat /bin/bash
Screenshot:
4. Copy webapps.dist to webapps
Code:
cp -r webapps.dist/* webapps
Screenshot:
Test:
There is nothing in the official mirror webapps, and access will report that the resource cannot be found, but after I copy the things in webapps.dist to webapps, visit it again and the default interface of tomcat will appear, as shown below
5. Submit our modified image
Code:
docker commit -a="作者" -m="描述" 容器id 目标名字:版本
Screenshot: