Docker ~ Install the new program in the centos container, dockercentos
In the previous article, we used Alibaba accelerator to install the centos image, created a new container, and run the image. In this article, we will add some applications for this image, then save the container and push the container to the warehouse. Then you can directly use pull to produce the container. It can be said that docker is generated by Environment deployment, which simplifies environment deployment!
Docker run centos yum install net-tools
2. run this program in the container and run docker run centos ping www.baidu.com
There are too many containers in the third container, which causes us a lot of trouble. Below are some ways to delete the container:
4. After the new program is installed, the following error occurs when the program is executed:
Exec: "wget": executable file not found in $ PATH
The cause of the above error is that your modification has not been submitted, that is, it has not taken effect yet. You need to submit it before knowing the docker image.
5. Submit container modifications
First, check the ID of the current container, docker ps-l
Submit the change to the centos container. docker commit 52e centos
A new ID is displayed after submission.
6. View All images and docker images
We can see that the newly added cetnos and e62 have already appeared in the list. It has installed the net-tools program.
7. During installation, you can directly install docker run in the container.
Docker run-t-I e62/bin/bash
Then the container is down.
You can directly install programs for this container, which is the same as running centos.
After submitting the application, run the newly installed program again!
Exit with exit in the current container and return to the centos console.
Submit, docker commit 1e5 e62
Run the program in the new container, docker run netstat
As a result, everything is normal!
Through this lecture, we have learned how to create and submit images, containers, and run statements to create new containers!
Hope to help you!