Basic operations of Docker images

The environment used in this article is Mac OS 10.11.5, Docker 1.12.0.

 

1. Search for mirrors

 

Use [docker search keyword] to search for shared images. The default search is for images in the official repository.

 

1. Search the mirror of mysql

 

 

The returned information has 5 columns, which represent: image name, image description, number of times it has been favorited, whether it is an official product, and whether it supports automatic creation.

 

2. Search for mysql mirrors that have been bookmarked more than 2 times

 

 

2. Get the mirror

 

Use [docker pull image name] to download the image from the network.

 

1. Download the mysql image

 

 

Use [docker pull image name] to download the latest tag image of the image set.

 

2. Download the 14.04 image of ubuntu

 

 

3. List local mirrors

 

Use [docker images] to list images owned on the local host.

 

 

The returned information has 5 columns, which represent: image name, image tag, image unique image id, creation time, and size.

 

Fourth, delete the local mirror

 

Use [docker rmi image id] to delete the local image, which cannot be deleted when there are still containers using the image.

 

1. Delete the ubuntu:14.04 image

 

 

When we delete the ubuntu:14.04 image, it removes all the AUFS layers that this image came with.

 

2. Delete the image with the container running

 

 

When we try to delete the ubuntu image, we are prompted that there are still containers using the image and cannot be deleted. To delete, you need to stop the container and use the -f parameter to force delete the image.

 

 

Five, upload the local mirror

 

Use [docker push image name] to upload the local image to the official repository.

 

 

You can also log in to Docker Hub to see the image just pushed.

 

 

6. Create a mirror

 

1. Import from the file system

 

 

2. Commit from an existing container to a new image

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327075984&siteId=291194637