After creating a container locally, you can create a local image based on this container and push this image to the Docker hub for download and use on the Internet. Now let’s put it into practice. docker pull nginx:1.15.3 Start a container using the command line: docker run -d -p 1080:80 --name jerry-nginx nginx:1.15.3 localhost:1080 Enter the container's shell: docker exec -it jerry-nginx /bin/bash View the default homepage of this nginx image: I want to use wget in the container, so I install it first: apt-get update && apt-get -y install wget Use the wget command to download an image file and an HTML file to the location where the Nginx server stores the web page: wget --no-check-certificate -O /usr/share/nginx/html/evil.jpg https://github.com/raw/slvi/docker-k8s-training/master/docker/res/evil.jpg wget --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 them. docker commit jerry-nginx jerry-modify-nginx:1.0 Use the command to set 1.0 as the latest tag: docker tag jerry-modify-nginx:1.0 jerry-modify-nginx:latest Use docker stop jerry-nginx to stop the old container, and then start the modified container jerry-modify-nginx: docker history View the history of this new image: Execute the command to label this 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 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Complete steps for uninstalling MySQL database
>>: Detailed explanation of 8 ways to pass parameters in Vue routing components
Table of contents What is the rest operator? How ...
question Nginx takes $remote_addr as the real IP ...
Since HTML email is not an independent HOST page o...
Definition of Generics // Requirement 1: Generics...
Table of contents Browser Same Origin Policy 1. V...
Table of contents nonsense text The first router/...
Table of contents 1. What is reflection? 2. Refle...
1. Cause The requirement is to display two lines,...
In LINUX, periodic tasks are usually handled by t...
The previous article introduced how to achieve a ...
Table of contents 1. Preprocessing 2. Pretreatmen...
This method was edited on February 7, 2021. The v...
Service.xml The Server.xml configuration file is ...
Keyboard Characters English ` backquote ~ tilde !...
environment: 1. Windows Server 2016 Datacenter 64...