Docker ~ Install the new program in the centos container, dockercentos

Source: Internet
Author: User
Tags exit in docker ps

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!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.