docker--using mirrors __docker

Source: Internet
Author: User
Tags tag name nginx server docker ps docker run
Docker Gitbook:Https://yeasy.gitbooks.io/docker_practice/content/index.html
Learning Docker process, with each step of the operation, resulting in a large number of stop the work of the container, want to quickly delete multiple containers, looked at the next Docker RM--help, plus StackOverflow saw someone else's question and answer, summed up 2 kinds of bulk Delete container method. Docker stop $ (Docker Ps-qa) #停止所有容器 Docker RM $ (Docker ps-qa) # Delete all stopped containers Docker Ps-qa | Xargs-n 1 Docker RM
using mirrorsSearch Mirrors: Docker search ubuntu:16.04 #镜像名: Version number pulled from warehouse mirroring: Docker pull ubuntu:16.04 #镜像名: Version number run container: Docker run Hello-world #容器名 Docker Run-i-T--rm ubuntu:16.04 bash-i Interactive operation-T use a terminal--RM container to exit after it is removed ubuntu:16.04 use the ubuntu:16.04 mirror base to start the container after bash mirror name, here is the interactive Shell Exit Container: Exit Viewing mirrorsLists all local mirrors (only the top-level mirrors are displayed): Docker image LS or docker images warehouse name label Mirror ID create time size Mirror ID is the unique identifier of the mirror, and a mirror can easily view mirrors, containers, and data volumes taken up by a mirrored label: dock ER system DF View virtual dangling mirrors (No label mirroring): Docker image ls-f dangling=true virtual suspension image can be deleted at will: Docker image prune lists all mirrors including middle-tier mirrors (for accelerated mirroring construction, reuse of resources do Cker uses middle-tier mirroring): Docker image ls-a, many of these label-free mirrors are mirrors that are dependent on other top-level mirrors and should not be deleted. List A mirror: Docker image ls hello-world #镜像名: Label name Remove MirrorDocker image rm Hello-world #镜像名: Tag name Docker image RM f2a91732366c #镜像ID because the container is mirrored, plus a layer of container storage layer, which is composed of such a multi-layer storage structure to run, If a mirror is dependent on a container, you need to remove the container before you can remove the mirror. submit mirroring to local repository (Docker commit, easy to cause image bloat)Docker commit [options] < container ID or container name > [< warehouse name >[:< tag]] Eg:docker commit \--author "Li Yue" \ #指定修改的作者--message "modifies the default Web page "\ #记录本次修改的内容 webserver \ #容器名称 nginx:v2 #新的镜像名称 Docker run--name web2-d-P 81:80 Nginx:liyue Remarks: This command starts with a nginx mirror Container, named webserver, and mapped 80 ports so that we could use the browser to access the Nginx server Docker run container--name: container name Docker exec-it the bash webserver ex EC enters container-it: Use terminal interactive operation webserver: container name bash: Enable Shell exit Container: Exit to modify a file inside a container is to change the storage layer of the container (mirroring, containers are tiered storage), using Docker diff Webserver (container name) view changes use Docker history webserver (container name) to view changes in the container history









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.