Basic management of Docker images and containers, docker image containers

Source: Internet
Author: User

Basic management of Docker images and containers, docker image containers

Three major Docker component repositories, images, and containers

Image images

Use docker images to view local images

(REPOSITORY: TAG of the REPOSITORY and TAG from, for example, latest. Image id: ID of the IMAGE, CREATED: Creation Time, SIZE: SIZE of the IMAGE.) I have no IMAGE, so nothing is displayed.

How to obtain an images can be downloaded from a public repository or created by yourself

First, download

Search for images docker search centos (centos keyword)


After finding images, we need to download it.

Docker pull Image Location; for example, docker pull docker. io/centos (the image is being downloaded)

(Download successful)

Now we can check the image (now we can see the image we just downloaded)


The above method is the image we downloaded from the public warehouse. How do we make the image? First, we should have a basic image to facilitate our expansion.

The following is a demonstration (I will use the image I just downloaded)

First, we will remember the container ID when running a container using an image to start.


After running the command, you can perform the operations required by the container. For example, you can install a web site.

Use the docker commint command to create an image


View images


We will find that one more one is the one we created.

Next, I will introduce a method for importing images.

Import from local file

We can download a template from the website and import it to the docker host.


Import and use the docker import command


Then we can view


Container Management

Containers are another core concept of Docker. Simply put, containers are one or more applications that run independently and Their runtime environments. The virtual machine can be understood as a complete set of operating systems (providing a running environment and other system environments) and running applications.

Container after startup


You can use docker ps to view container processes.


I haven't run the container yet, so I haven't)

We can use docker start to start a stopped container.

When we view it again, we will find that a container is running.


If you want to disable or stop docker, you can use docker kill [container ID] or docker stop [container ID] to restart docker restart [container ID]

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.