docker commit to build the mirror

# When using a docker hub warehouse mirroring can not meet the demand, you need customized image
1, image running a nginx1.76.1 container web1
Docker RUN --name web1 -d -p 80:80 nginx: 1.76.1
# Direct access to see nginx to default page

 

 


2, into the container modify Home
Docker Exec -it web1 bash
echo '<h1> the Hello Docker nginx 1.16.1 Server </ h1>' >> / usr / report this content share / nginx / HTML / index.html
# exit container, another visit to see Home content has changed

 

 
3. Check the container vessel name change available docker diff
# OK to save constitute a new image
docker commit --author "felix xie <[email protected] >" --message " changed the default home page content" web1 nginx: v1
# View the finished image
Docker ImagesRF Royalty Free nginx
Docker history nginx: v1 # view mirror of history

Guess you like

Origin www.cnblogs.com/xiefugui/p/12155028.html