Docker以守护状态运行
[root@docker ~]# docker run -d docker.io/ubuntu:latest /bin/sh -c "while true;do echo fwc; \
sleep 1;done"
9cd3a0312b95f3ff52138547a983ea16bb2fa3a0d5cb8f4b198a515ae0fd71e6
查看容器信息
[root@docker ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9cd3a0312b95 docker.io/ubuntu:latest "/bin/sh -c 'while tr" 5 seconds ago Up 3 seconds elated_lalande
获取容器输出信息
[root@docker ~]# docker logs 9cd3a031
fwc
fwc
fwc
fwc
fwc
fwc