2024年11月Linux中Docker容器使用实例(2)

发布时间:

  ⑴查看容器中运行的进程

  ⑵root:/# ps -aux

  ⑶USER PID %CPU %MEM VSZ RSS TTY STAT START TIME MAND

  ⑷root . . ? Ss : : /bin/bash

  ⑸root . . ? R+ : : ps -aux

  ⑹在容器中安装一个软件包

  ⑺root:/# apt-get update && apt-get install vim

  ⑻Ign trusty InRelease

  ⑼Ign trusty-updates InRelease

  ⑽Ign trusty-security InRelease

  ⑾Hit trusty Release.gpg

  ⑿Get: trusty-updates Release.gpg [ B]

  ⒀Get: trusty-security Release.gpg [ B]

  ⒁Hit trusty Release

  ⒂Get: trusty-updates Release [. kB]

  ⒃Get: trusty-security Release [. kB]

  ⒄Get: trusty/main Sources [ kB]

  ⒅Get: trusty/restricted Sources [ B]

  ⒆Get: trusty/universe Sources [ kB]

  ⒇Get: trusty/main amd Packages [ kB]

  ⒈Get: trusty/restricted amd Packages [. kB]

  ⒉Get: trusty/universe amd Packages [ kB]

  ⒊Get: trusty-updates/main Sources [ kB]

  ⒋Get: trusty-updates/restricted Sources [ B]

  ⒌Get: trusty-updates/universe Sources [ kB]

  ⒍Get: trusty-updates/main amd Packages [ kB]

  ⒎Get: trusty-updates/restricted amd Packages [. kB]

  ⒏Get: trusty-updates/universe amd Packages [ kB]

  ⒐Get: trusty-security/main Sources [. kB]

  ⒑Get: trusty-security/restricted Sources [ B]

  ⒒Get: trusty-security/universe Sources [. kB]

  ⒓Get: trusty-security/main amd Packages [ kB]

  ⒔Get: trusty-security/restricted amd Packages [. kB]

  ⒕Get: trusty-security/universe amd Packages [. kB]

  ⒖Fetched . MB in s ( kB/s

  ⒗Reading package lists.。。 Done

  ⒘Reading package lists.。。 Done

  ⒙Building dependency tree

  ⒚Reading state information.。。 Done

  ⒛The following extra packages will be installed:

  ①libgpm libpython. libpython.-minimal libpython.-stdlib vim-runtime

  ②Suggested packages:

  ③gpm ctags vim-doc vim-scripts

  ④The following NEW packages will be installed:

  ⑤libgpm libpython. libpython.-minimal libpython.-stdlib vim

  ⑥vim-runtime

  ⑦ upgraded, newly installed, to remove and not upgraded.

  ⑧Need to get kB of archives.

  ⑨After this operation, . MB of additional disk space will be used.

  ⑩Do you want to continue? [Y/n] y

  ⅠGet: trusty/main libgpm amd ..-. [. kB]

  ⅡGet: trusty/main libpython.-minimal amd ..- [ kB]

  ⅢGet: trusty/main libpython.-stdlib amd ..- [ kB]

  ⅣGet: trusty/main libpython. amd ..- [ kB]

  ⅤGet: trusty/main vim-runtime all :..-ubuntu [ kB]

  ⅥGet: trusty/main vim amd :..-ubuntu [ kB]