Docker basics 3-the basic operation of the container:
[root@centos77 ~]# docker run -it -d --name blab1 busybox:latest /bin/sh
a88ea6f7c705badf4808fa79b6994f29b8f4b36da975ca793fc76d717ad93721
[root@centos77 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a88ea6f7c705 busybox:latest "/bin/sh" 8 seconds ago Up 7 seconds blab1
Parameter description:
-i: standard input
-t: open a new terminal
-d: run in the background [generally must have this parameter], which is equivalent to open an additional terminal, to ensure that the container will not exit the program because the program is executed, thus Exit the container.
--Name: The function is to give the container a name to facilitate system operation and maintenance in the future.
View the content information of the started container
[root@centos77 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a88ea6f7c705 busybox:latest "/bin/sh" 2 minutes ago Up 2 minutes blab1