docker-2 - basic commands

Come to docker for the second bomb today,

        simple little demo

                1.sudo docker run ubuntu /bin/echo 'hello world' #where ubuntu is the image name, if there is no such image locally, it will go to the remote warehouse to find it

                2. sudo docker run -t -i ubuntu /bin/bash #Use ubuntu's command line

                3.sudo docker run -d ubuntu /bin/sh -c "whild true;do echo hello world;sleep 1;done" #-d option means start as a daemon

        Basic commands use:

                1.$ sudo docker ps #Check how many docker daemons are there, usually you will see the name container id, image image, name name and other information of the docker daemon

                2.$ sudo docker logs name #View relevant information according to the name of the docker daemon

                3.$ sudo docker stop name #Stop the specified container according to the name of the docker daemon

 

write this today

 

 

Guess you like

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