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
The company's service uses docker, and the di...
This article is a simple calculator written using...
What is HTML? HTML is a language used to describe...
Now that we have finished the transform course, l...
I love coding, it makes me happy! Hello everyone,...
Linux Operation Experimental environment: Centos7...
Docker version 1.13.1 Problem Process A MySQL con...
Since the standard ab only supports stress testin...
Table of contents Listener watch Format Set up th...
Table of contents 1. Installation of JDK1.8 under...
Table of contents About MariaDB database in Linux...
Today I saw a little trick for HTML text escaping ...
Recently, there have been many database-related o...
1. Problem description <br />When JS is use...
Question. In the mobile shopping mall system, we ...