In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use the Docker image submission command commit". In the daily operation, I believe many people have doubts about how to use the Docker image submission command commit. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use the Docker image submission command commit". Next, please follow the editor to study!
After creating a container locally, you can create a local image based on the container, and push the image to docker hub for download and use on the network.
Let's put it into practice.
Docker pull nginx:1.15.3
Start a container with the command line:
Docker run-d-p 1080 docker run-- name jerry-nginx nginx:1.15.3
Localhost:1080
Enter the shell of the container:
Docker exec-it jerry-nginx / bin/bash
Check the default home page of this nginx image:
I want to use wget in the container, so install it first:
Apt-get update & & apt-get-y install wget
Use the wget command to download an image file and a html file to the location of the nginx server where the web page is stored:
Wget-- no-check-certificate-o / usr/share/nginx/html/evil.jpg https://github.com/raw/slvi/docker-k8s-training/master/docker/res/evil.jpgwget-- no-check-certificate-o / usr/share/nginx/html/index.html https://github.com/raw/slvi/docker-k8s-training/master/docker/res/evil.html
Refresh the page, and the page we see now has become the page downloaded by wget:
We now want to solidify the changes found in this container so that others can use it.
Docker commit jerry-nginx jerry-modify-nginx:1.0
Use the command to set 1.0 to latest tag:
Docker tag jerry-modify-nginx:1.0 jerry-modify-nginx:latest
Stop the old container with docker stop jerry-nginx, and then start the modified container jerry-modify-nginx:
Docker history name to view the history of this new image:
Execute the command to label the new image:
Docker tag jerry-modify-nginx:latest registry.ingress.shcw46.k8s-train.shoot.canary.k8s-hana.ondemand.com/jerry-modify-nginx:760d7ca6
Push the tagged image to the remote end:
Docker push registry.ingress.shcw46.k8s-train.shoot.canary.k8s-hana.ondemand.com/jerry-modify-nginx:760d7ca6
At this point, the study on "how to use the Docker image submission command commit" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.