1. 程式人生 > >docker stats top diff和cp

docker stats top diff和cp

實戰
[[email protected] ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1fb916fb0e13 6a "sh" About an hour ago Created hello2
9fb1ff8de577 6a "sh" About an hour ago Up About an hour hello
[[email protected] ~]# docker stats
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9fb1ff8de577 0.00% 52KiB / 993MiB 0.01% 648B / 0B 0B / 0B 0
^C
[

[email protected] ~]# docker stats -a
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
1fb916fb0e13 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0
9fb1ff8de577 0.00% 52KiB / 993MiB 0.01% 648B / 0B 0B / 0B 0
^C
[[email protected] ~]# docker stats 9f
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
9f 0.00% 52KiB / 993MiB 0.01% 648B / 0B 0B / 0B 0
^C
[
[email protected]
~]# docker top 9f
UID PID PPID C STIME TTY TIME CMD
root 8220 8206 0 10:59 pts/0 00:00:00 sh
[[email protected] ~]# docker diff 9f
C /root
A /root/.ash_history
[[email protected] ~]# docker attach 9f
/ # ls
bin dev etc home proc root sys tmp usr var
[[email protected] ~]# docker cp 33.tar 9f:/root/
[
[email protected]
~]# docker attach 9f
/ # ls
bin dev etc home proc root sys tmp usr var
/ # cd root
~ # ls
33.tar
[[email protected] ~]# docker diff 9f
C /root
A /root/.ash_history
A /root/33.tar
[[email protected] ~]# docker cp 9f:/root/.ash_history ./
[[email protected] ~]# cat ./.ash_history
ls
top
ls
exit
ls
exit
ls
cd root
ls
[[email protected] ~]#
---------------------
作者:chengqiuming
來源:CSDN
原文:https://blog.csdn.net/chengqiuming/article/details/78975890
版權宣告:本文為博主原創文章,轉載請附上博文連結!