Getting Started with Docker (Mac Environment)-part 1 Basic operations

Source: Internet
Author: User
Tags docker hub docker run

Part-1 Getting Started basic Operation Docker installation
    1. To the official website to download the corresponding version, and then click on the installation can be;
    2. If the environment is Linux, you can refer to the previously written get started tutorial
View the Docker version
    1. docker --version, many software versions are detected in this way and are easy to remember. If you hit docker version , you'll get more detailed information.
?  ~ docker --versionDocker version 17.12.0-ce, build c97c6d6?  ~ docker versionClient: Version:   17.12.0-ce API version:   1.35 Go version:    go1.9.2 Git commit:    c97c6d6 Built: Wed Dec 27 20:03:51 2017 OS/Arch:   darwin/amd64Server: Engine:  Version:  17.12.0-ce  API version:  1.35 (minimum version 1.12)  Go version:   go1.9.2  Git commit:   c97c6d6  Built:    Wed Dec 27 20:12:29 2017  OS/Arch:  linux/amd64  Experimental: true
    1. Docker info gets more detailed information than Docker version , as follows:
? ~ Docker infocontainers:2 running:0 paused:0 stopped:2images:1server version:17.12.0-cestorage driver:overlay2 back ing filesystem:extfs Supports d_type:true Native Overlay diff:truelogging driver:json-filecgroup Driver:cgroupfsplugi Ns:Volume:local Network:bridge host Ipvlan macvlan null overlay log:awslogs fluentd gcplogs gelf Journald json-file Lo Gentries splunk syslogSwarm:inactiveRuntimes:runcDefault runtime:runcinit binary:docker-initcontainerd version: 89623f28b87a6004d4b785663257362d1658a729runc Version:b2567b37d7b75eb4cf325b77297b140ea686ce8finit Version: 949e6fasecurity Options:seccomp profile:defaultkernel version:4.9.60-linuxkit-aufsoperating system:docker for MacOST Ype:linuxarchitecture:x86_64cpus:2total memory:1.952gibname:linuxkit-025000000001id:vsoe:2ydp:c37g:upuk:6z47: Nmmq:2hfg:6rqf:iuaa:bjpx:x3qk:psildocker Root Dir:/var/lib/dockerdebug mode (client): Falsedebug mode (server): True File descriptors:22 goroutines:41 System time:2018-07-09t08:25:19.054780468z eventslisteners:2http Proxy:docker.for.mac.http.internal:3128https Proxy: Docker.for.mac.http.internal:3129registry:https://index.docker.io/v1/labels:experimental:trueinsecure Registries:127.0.0.0/8live Restore Enabled:false
Check the installation of Docker
    1. You can detect if Docker is installed successfully by running a simple Docker image, and the command is a common Hello world,docker run hello-world
? ~ Docker run hello-worldunable to find image ' Hello-world:latest ' locallylatest:pulling from Library/hello-world9bb5a5d4 561a:pull Completedigest:sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35dstatus: Downloaded newer image for Hello-world:latesthello from docker! This message shows the your installation appears to be working correctly. To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.    2. The Docker daemon pulled the "Hello-world" image from the Docker Hub. (AMD64)  3. The Docker daemon created a new container from this image which runs the executable that produces the output is Currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something + ambitious, you can run an Ubuntu container with: $ docker run-it ubuntu Bashshare images, automate Workflows, and more with a free Docker id:https://hub.docker.com/for more ExaMples and ideas, visit:https://docs.docker.com/engine/userguide/ 
    1. Can see actually started on the machine and did not install Hello-world this image, he automatically downloaded from the Docker-hub, and then started, the following text describes the whole process, also prompted to try Ubuntu bash, etc.
    2. You can use the LS command to see what mirrors are in this machine.docker image ls
?  ~ docker image lsREPOSITORY          TAG                 IMAGE ID            CREATED             SIZEhello-world         latest              e38bc07ac18e        2 months ago        1.85kB
    1. docker container lsCan be used to view the running container, plus --all parameters can see the history of the Run
?  ~ docker container lsCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES?  ~ docker container ls --allCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMEScbcd0f49f39d        hello-world         "/hello"            4 minutes ago       Exited (0) 4 minutes ago                        epic_poincare14ade628e65a        hello-world         "/hello"            18 minutes ago      Exited (0) 18 minutes ago                       flamboyant_belld0a7facb8e31        hello-world         "/hello"            18 minutes ago      Exited (0) 18 minutes ago                       cranky_cray
    1. docker container ls -aq, view all process history in refreshing mode (all in quiet modes)
?  ~ docker container ls -aqcbcd0f49f39d14ade628e65ad0a7facb8e31

Getting Started with Docker (Mac Environment)-part 1 basic operations

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.