【Docker】進階之路:(四)操作容器

【Docker】進階之路:(四)Docker容器

  • 容器的生命周期
  • 創建容器
    • docker create
    • docker run
  • 管理容器
    • 查看運行的容器:
    • 查看所有容器:
  • 啟動與終止
    • 啟動容器
    • 終止容器
  • 進入容器
    • docker attach
    • docker exec
  • 導出和導入
    • 導出
    • 導入

容器的生命周期

容器的生命周期分為五種狀態,分別為:

  • Created:初建狀態,表示容器已經被創建,容器所需的相關資源已經準備就緒,但容器中的程序還未處于運行狀態。
  • Running:運行狀態,表示容器正在運行,也就是容器中的應用正在運行。
  • Paused:暫停狀態,表示容器已暫停,表示容器中的所有程序都處于暫停(不是停止)狀態。
  • Stopped:停止狀態,表示容器處于停止狀態,占用的資源和沙盒環境都依然存在,只是容器中的應用程序均已停止。
  • Deleted:刪除狀態,表示容器已刪除,相關占用的資源及存儲在 Docker 中的管理信息也都已釋放和移除。

創建容器

容器是Docker提供網絡服務的主體。為了能夠提供MySQL、Apache等網絡服務,用戶必須創建對應的容器。
在Docker中,用戶可以通過兩種方式來創建容器。

docker create

[root@docker ~]# docker create --helpUsage:  docker create [OPTIONS] IMAGE [COMMAND] [ARG...]Create a new containerAliases:docker container create, docker createOptions:--add-host list                  Add a custom host-to-IP mapping (host:ip)--annotation map                 Add an annotation to the container (passed through to the OCI runtime) (default map[])-a, --attach list                    Attach to STDIN, STDOUT or STDERR--blkio-weight uint16            Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)--blkio-weight-device list       Block IO weight (relative device weight) (default [])--cap-add list                   Add Linux capabilities--cap-drop list                  Drop Linux capabilities--cgroup-parent string           Optional parent cgroup for the container--cgroupns string                Cgroup namespace to use (host|private)'host':    Run the container in the Docker host's cgroup namespace'private': Run the container in its own private cgroup namespace'':        Use the cgroup namespace as configured by thedefault-cgroupns-mode option on the daemon (default)--cidfile string                 Write the container ID to the file--cpu-period int                 Limit CPU CFS (Completely Fair Scheduler) period--cpu-quota int                  Limit CPU CFS (Completely Fair Scheduler) quota--cpu-rt-period int              Limit CPU real-time period in microseconds--cpu-rt-runtime int             Limit CPU real-time runtime in microseconds-c, --cpu-shares int                 CPU shares (relative weight)--cpus decimal                   Number of CPUs--cpuset-cpus string             CPUs in which to allow execution (0-3, 0,1)--cpuset-mems string             MEMs in which to allow execution (0-3, 0,1)--device list                    Add a host device to the container--device-cgroup-rule list        Add a rule to the cgroup allowed devices list--device-read-bps list           Limit read rate (bytes per second) from a device (default [])--device-read-iops list          Limit read rate (IO per second) from a device (default [])--device-write-bps list          Limit write rate (bytes per second) to a device (default [])--device-write-iops list         Limit write rate (IO per second) to a device (default [])--disable-content-trust          Skip image verification (default true)--dns list                       Set custom DNS servers--dns-option list                Set DNS options--dns-search list                Set custom DNS search domains--domainname string              Container NIS domain name--entrypoint string              Overwrite the default ENTRYPOINT of the image-e, --env list                       Set environment variables--env-file list                  Read in a file of environment variables--expose list                    Expose a port or a range of ports--gpus gpu-request               GPU devices to add to the container ('all' to pass all GPUs)--group-add list                 Add additional groups to join--health-cmd string              Command to run to check health--health-interval duration       Time between running the check (ms|s|m|h) (default 0s)--health-retries int             Consecutive failures needed to report unhealthy--health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)--health-timeout duration        Maximum time to allow one check to run (ms|s|m|h) (default 0s)--help                           Print usage-h, --hostname string                Container host name--init                           Run an init inside the container that forwards signals and reaps processes-i, --interactive                    Keep STDIN open even if not attached--ip string                      IPv4 address (e.g., 172.30.100.104)--ip6 string                     IPv6 address (e.g., 2001:db8::33)--ipc string                     IPC mode to use--isolation string               Container isolation technology--kernel-memory bytes            Kernel memory limit-l, --label list                     Set meta data on a container--label-file list                Read in a line delimited file of labels--link list                      Add link to another container--link-local-ip list             Container IPv4/IPv6 link-local addresses--log-driver string              Logging driver for the container--log-opt list                   Log driver options--mac-address string             Container MAC address (e.g., 92:d0:c6:0a:29:33)-m, --memory bytes                   Memory limit--memory-reservation bytes       Memory soft limit--memory-swap bytes              Swap limit equal to memory plus swap: '-1' to enable unlimited swap--memory-swappiness int          Tune container memory swappiness (0 to 100) (default -1)--mount mount                    Attach a filesystem mount to the container--name string                    Assign a name to the container--network network                Connect a container to a network--network-alias list             Add network-scoped alias for the container--no-healthcheck                 Disable any container-specified HEALTHCHECK--oom-kill-disable               Disable OOM Killer--oom-score-adj int              Tune host's OOM preferences (-1000 to 1000)--pid string                     PID namespace to use--pids-limit int                 Tune container pids limit (set -1 for unlimited)--platform string                Set platform if server is multi-platform capable--privileged                     Give extended privileges to this container-p, --publish list                   Publish a container's port(s) to the host-P, --publish-all                    Publish all exposed ports to random ports--pull string                    Pull image before creating ("always", "|missing", "never") (default "missing")-q, --quiet                          Suppress the pull output--read-only                      Mount the container's root filesystem as read only--restart string                 Restart policy to apply when a container exits (default "no")--rm                             Automatically remove the container when it exits--runtime string                 Runtime to use for this container--security-opt list              Security Options--shm-size bytes                 Size of /dev/shm--stop-signal string             Signal to stop the container--stop-timeout int               Timeout (in seconds) to stop a container--storage-opt list               Storage driver options for the container--sysctl map                     Sysctl options (default map[])--tmpfs list                     Mount a tmpfs directory-t, --tty                            Allocate a pseudo-TTY--ulimit ulimit                  Ulimit options (default [])-u, --user string                    Username or UID (format: <name|uid>[:<group|gid>])--userns string                  User namespace to use--uts string                     UTS namespace to use-v, --volume list                    Bind mount a volume--volume-driver string           Optional volume driver for the container--volumes-from list              Mount volumes from the specified container(s)-w, --workdir string                 Working directory inside the container
[root@docker ~]# 

docker run

[root@docker ~]# docker run --helpUsage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Create and run a new container from an imageAliases:docker container run, docker runOptions:--add-host list                  Add a custom host-to-IP mapping (host:ip)--annotation map                 Add an annotation to the container (passed through to the OCI runtime) (default map[])-a, --attach list                    Attach to STDIN, STDOUT or STDERR--blkio-weight uint16            Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)--blkio-weight-device list       Block IO weight (relative device weight) (default [])--cap-add list                   Add Linux capabilities--cap-drop list                  Drop Linux capabilities--cgroup-parent string           Optional parent cgroup for the container--cgroupns string                Cgroup namespace to use (host|private)'host':    Run the container in the Docker host's cgroup namespace'private': Run the container in its own private cgroup namespace'':        Use the cgroup namespace as configured by thedefault-cgroupns-mode option on the daemon (default)--cidfile string                 Write the container ID to the file--cpu-period int                 Limit CPU CFS (Completely Fair Scheduler) period--cpu-quota int                  Limit CPU CFS (Completely Fair Scheduler) quota--cpu-rt-period int              Limit CPU real-time period in microseconds--cpu-rt-runtime int             Limit CPU real-time runtime in microseconds-c, --cpu-shares int                 CPU shares (relative weight)--cpus decimal                   Number of CPUs--cpuset-cpus string             CPUs in which to allow execution (0-3, 0,1)--cpuset-mems string             MEMs in which to allow execution (0-3, 0,1)-d, --detach                         Run container in background and print container ID--detach-keys string             Override the key sequence for detaching a container--device list                    Add a host device to the container--device-cgroup-rule list        Add a rule to the cgroup allowed devices list--device-read-bps list           Limit read rate (bytes per second) from a device (default [])--device-read-iops list          Limit read rate (IO per second) from a device (default [])--device-write-bps list          Limit write rate (bytes per second) to a device (default [])--device-write-iops list         Limit write rate (IO per second) to a device (default [])--disable-content-trust          Skip image verification (default true)--dns list                       Set custom DNS servers--dns-option list                Set DNS options--dns-search list                Set custom DNS search domains--domainname string              Container NIS domain name--entrypoint string              Overwrite the default ENTRYPOINT of the image-e, --env list                       Set environment variables--env-file list                  Read in a file of environment variables--expose list                    Expose a port or a range of ports--gpus gpu-request               GPU devices to add to the container ('all' to pass all GPUs)--group-add list                 Add additional groups to join--health-cmd string              Command to run to check health--health-interval duration       Time between running the check (ms|s|m|h) (default 0s)--health-retries int             Consecutive failures needed to report unhealthy--health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)--health-timeout duration        Maximum time to allow one check to run (ms|s|m|h) (default 0s)--help                           Print usage-h, --hostname string                Container host name--init                           Run an init inside the container that forwards signals and reaps processes-i, --interactive                    Keep STDIN open even if not attached--ip string                      IPv4 address (e.g., 172.30.100.104)--ip6 string                     IPv6 address (e.g., 2001:db8::33)--ipc string                     IPC mode to use--isolation string               Container isolation technology--kernel-memory bytes            Kernel memory limit-l, --label list                     Set meta data on a container--label-file list                Read in a line delimited file of labels--link list                      Add link to another container--link-local-ip list             Container IPv4/IPv6 link-local addresses--log-driver string              Logging driver for the container--log-opt list                   Log driver options--mac-address string             Container MAC address (e.g., 92:d0:c6:0a:29:33)-m, --memory bytes                   Memory limit--memory-reservation bytes       Memory soft limit--memory-swap bytes              Swap limit equal to memory plus swap: '-1' to enable unlimited swap--memory-swappiness int          Tune container memory swappiness (0 to 100) (default -1)--mount mount                    Attach a filesystem mount to the container--name string                    Assign a name to the container--network network                Connect a container to a network--network-alias list             Add network-scoped alias for the container--no-healthcheck                 Disable any container-specified HEALTHCHECK--oom-kill-disable               Disable OOM Killer--oom-score-adj int              Tune host's OOM preferences (-1000 to 1000)--pid string                     PID namespace to use--pids-limit int                 Tune container pids limit (set -1 for unlimited)--platform string                Set platform if server is multi-platform capable--privileged                     Give extended privileges to this container-p, --publish list                   Publish a container's port(s) to the host-P, --publish-all                    Publish all exposed ports to random ports--pull string                    Pull image before running ("always", "missing", "never") (default "missing")-q, --quiet                          Suppress the pull output--read-only                      Mount the container's root filesystem as read only--restart string                 Restart policy to apply when a container exits (default "no")--rm                             Automatically remove the container when it exits--runtime string                 Runtime to use for this container--security-opt list              Security Options--shm-size bytes                 Size of /dev/shm--sig-proxy                      Proxy received signals to the process (default true)--stop-signal string             Signal to stop the container--stop-timeout int               Timeout (in seconds) to stop a container--storage-opt list               Storage driver options for the container--sysctl map                     Sysctl options (default map[])--tmpfs list                     Mount a tmpfs directory-t, --tty                            Allocate a pseudo-TTY--ulimit ulimit                  Ulimit options (default [])-u, --user string                    Username or UID (format: <name|uid>[:<group|gid>])--userns string                  User namespace to use--uts string                     UTS namespace to use-v, --volume list                    Bind mount a volume--volume-driver string           Optional volume driver for the container--volumes-from list              Mount volumes from the specified container(s)-w, --workdir string                 Working directory inside the container
[root@docker ~]# 

管理容器

使用Docker一段時間后,計算機上或許會有許多云心和非運行的容器。

[root@docker ~]# docker ps --helpUsage:  docker ps [OPTIONS]List containersAliases:docker container ls, docker container list, docker container ps, docker psOptions:-a, --all             Show all containers (default shows just running)-f, --filter filter   Filter output based on conditions provided--format string   Format output using a custom template:'table':            Print output in table format with column headers (default)'table TEMPLATE':   Print output in table format using the given Go template'json':             Print in JSON format'TEMPLATE':         Print output using the given Go template.Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates-n, --last int        Show n last created containers (includes all states) (default -1)-l, --latest          Show the latest created container (includes all states)--no-trunc        Don't truncate output-q, --quiet           Only display container IDs-s, --size            Display total file sizes
[root@docker ~]# 

查看運行的容器:

[root@docker ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@docker ~]# 

查看所有容器:

[root@docker ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@docker ~]# 

啟動與終止

啟動容器

容器是交互式的,有點類似于虛擬機,且更加有利于資源的高效利用。例如,使用Ubuntu的最新鏡像運行一個容器。-i和-t子命令的意思提供了對容器的交互式shell訪問:

這里我們選用ubuntu鏡像,為什么使用ubentu鏡像呢?

[root@docker ~]# docker images
REPOSITORY           TAG                 IMAGE ID       CREATED         SIZE
circledba/kingbase   v008r006c007b0024   df101ff5974d   40 hours ago    12.4GB
tomcat               latest              fb5657adc892   23 months ago   680MB
ubuntu               latest              ba6acccedd29   2 years ago     72.8MB
centos               7                   eeb6ee3f44bd   2 years ago     204MB
[root@docker ~]# 

centos7鏡像大小為204MB,ubuntu只有72.8MB

現在已經進入docker內部,在這個環境下,shell展現如下:

[root@docker ~]# docker run -it ubuntu
root@12adcd8f7dd9:/#

注意:ubuntu鏡像是最小化的基本上沒有什么常用的用具,比如說ip命令等,演示如下

root@12adcd8f7dd9:/# ip
bash: ip: command not found
root@12adcd8f7dd9:/# yum
bash: yum: command not found
root@12adcd8f7dd9:/# 

那就需要我們手動安裝

  1. 我們先更新apt工具(不更新會找不到很多包)
apt-get update
apt-get upgrade

運行示例:

root@12adcd8f7dd9:/# apt-get update
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                         
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]               
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]               
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]                 
Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]           
Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3245 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1443 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [3272 kB] 
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [32.0 kB]  
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [3754 kB]         
Get:14 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [55.2 kB]                      
Get:15 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [28.6 kB]                  
Get:16 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [1148 kB]                  
Get:17 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [29.3 kB]                
Get:18 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [3079 kB]                
Fetched 29.5 MB in 50s (596 kB/s)                                                                          
Reading package lists... Done
root@12adcd8f7dd9:/# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:apt base-files bash bsdutils dpkg e2fsprogs fdisk gcc-10-base gpgv gzip libapt-pkg6.0 libblkid1 libc-binlibc6 libcom-err2 libext2fs2 libfdisk1 libgcc-s1 libgmp10 libgnutls30 liblzma5 libmount1 libncurses6libncursesw6 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre2-8-0 libpcre3 libprocps8libseccomp2 libsepol1 libsmartcols1 libss2 libstdc++6 libsystemd0 libtinfo6 libudev1 libuuid1 loginlogsave mount ncurses-base ncurses-bin passwd perl-base procps tar util-linux zlib1g
51 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.0 MB of archives.
After this operation, 39.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gcc-10-base amd64 10.5.0-1ubuntu1~20.04 [20.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgcc-s1 amd64 10.5.0-1ubuntu1~20.04 [41.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libstdc++6 amd64 10.5.0-1ubuntu1~20.04 [501 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6 amd64 2.31-0ubuntu9.14 [2725 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.7 [60.4 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 bash amd64 5.0-6ubuntu1.2 [639 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 bsdutils amd64 1:2.34-0.1ubuntu9.4 [63.0 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 tar amd64 1.30+dfsg-7ubuntu0.20.04.3 [240 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 dpkg amd64 1.19.7ubuntu3.2 [1128 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gzip amd64 1.10-0ubuntu4.1 [95.2 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 login amd64 1:4.8.1-1ubuntu5.20.04.4 [221 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ncurses-bin amd64 6.2-0ubuntu2.1 [172 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 perl-base amd64 5.30.0-9ubuntu0.5 [1514 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libblkid1 amd64 2.34-0.1ubuntu9.4 [137 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libuuid1 amd64 2.34-0.1ubuntu9.4 [20.0 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libfdisk1 amd64 2.34-0.1ubuntu9.4 [174 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libmount1 amd64 2.34-0.1ubuntu9.4 [150 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses6 amd64 6.2-0ubuntu2.1 [101 kB] 
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncursesw6 amd64 6.2-0ubuntu2.1 [132 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libtinfo6 amd64 6.2-0ubuntu2.1 [87.4 kB]  
Get:21 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsmartcols1 amd64 2.34-0.1ubuntu9.4 [100 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 fdisk amd64 2.34-0.1ubuntu9.4 [119 kB]    
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 util-linux amd64 2.34-0.1ubuntu9.4 [1021 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-bin amd64 2.31-0ubuntu9.14 [635 kB]                                                                                                                                                                                                                                   
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ncurses-base all 6.2-0ubuntu2.1 [18.9 kB]                                                                                                                                                                                                                                  
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 liblzma5 amd64 5.2.4-1ubuntu1.1 [91.8 kB]                                                                                                                                                                                                                                  
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsystemd0 amd64 245.4-4ubuntu3.22 [267 kB]                                                                                                                                                                                                                               
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libudev1 amd64 245.4-4ubuntu3.22 [75.4 kB]                                                                                                                                                                                                                                 
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 zlib1g amd64 1:1.2.11.dfsg-2ubuntu1.5 [54.2 kB]                                                                                                                                                                                                                            
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.10 [843 kB]                                                                                                                                                                                                                                        
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpgv amd64 2.2.19-3ubuntu2.2 [200 kB]                                                                                                                                                                                                                                      
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgmp10 amd64 2:6.2.0+dfsg-4ubuntu0.1 [241 kB]                                                                                                                                                                                                                            
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgnutls30 amd64 3.6.13-2ubuntu1.9 [828 kB]                                                                                                                                                                                                                               
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libseccomp2 amd64 2.5.1-1ubuntu1~20.04.2 [42.5 kB]                                                                                                                                                                                                                         
Get:35 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.10 [1280 kB]                                                                                                                                                                                                                                                 
Get:36 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam0g amd64 1.3.1-5ubuntu4.6 [55.3 kB]                                                                                                                                                                                                                                  
Get:37 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam-modules-bin amd64 1.3.1-5ubuntu4.6 [41.2 kB]                                                                                                                                                                                                                        
Get:38 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam-modules amd64 1.3.1-5ubuntu4.6 [260 kB]                                                                                                                                                                                                                             
Get:39 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 logsave amd64 1.45.5-2ubuntu1.1 [10.2 kB]                                                                                                                                                                                                                                  
Get:40 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libext2fs2 amd64 1.45.5-2ubuntu1.1 [183 kB]                                                                                                                                                                                                                                
Get:41 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 e2fsprogs amd64 1.45.5-2ubuntu1.1 [527 kB]                                                                                                                                                                                                                                 
Get:42 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mount amd64 2.34-0.1ubuntu9.4 [115 kB]                                                                                                                                                                                                                                     
Get:43 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam-runtime all 1.3.1-5ubuntu4.6 [37.3 kB]                                                                                                                                                                                                                              
Get:44 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpcre2-8-0 amd64 10.34-7ubuntu0.1 [198 kB]                                                                                                                                                                                                                               
Get:45 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpcre3 amd64 2:8.39-12ubuntu0.1 [232 kB]                                                                                                                                                                                                                                 
Get:46 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsepol1 amd64 3.0-1ubuntu0.1 [252 kB]                                                                                                                                                                                                                                    
Get:47 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 passwd amd64 1:4.8.1-1ubuntu5.20.04.4 [799 kB]                                                                                                                                                                                                                             
Get:48 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcom-err2 amd64 1.45.5-2ubuntu1.1 [9548 B]                                                                                                                                                                                                                               
Get:49 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libprocps8 amd64 2:3.3.16-1ubuntu2.4 [33.1 kB]                                                                                                                                                                                                                             
Get:50 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libss2 amd64 1.45.5-2ubuntu1.1 [11.3 kB]                                                                                                                                                                                                                                   
Get:51 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 procps amd64 2:3.3.16-1ubuntu2.4 [232 kB]                                                                                                                                                                                                                                  
Fetched 17.0 MB in 1min 3s (270 kB/s)                                                                                                                                                                                                                                                                                                       
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../gcc-10-base_10.5.0-1ubuntu1~20.04_amd64.deb ...
Unpacking gcc-10-base:amd64 (10.5.0-1ubuntu1~20.04) over (10.3.0-1ubuntu1~20.04) ...
Setting up gcc-10-base:amd64 (10.5.0-1ubuntu1~20.04) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libgcc-s1_10.5.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libgcc-s1:amd64 (10.5.0-1ubuntu1~20.04) over (10.3.0-1ubuntu1~20.04) ...
Setting up libgcc-s1:amd64 (10.5.0-1ubuntu1~20.04) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libstdc++6_10.5.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libstdc++6:amd64 (10.5.0-1ubuntu1~20.04) over (10.3.0-1ubuntu1~20.04) ...
Setting up libstdc++6:amd64 (10.5.0-1ubuntu1~20.04) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libc6_2.31-0ubuntu9.14_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Unpacking libc6:amd64 (2.31-0ubuntu9.14) over (2.31-0ubuntu9.2) ...
Setting up libc6:amd64 (2.31-0ubuntu9.14) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../base-files_11ubuntu5.7_amd64.deb ...
Unpacking base-files (11ubuntu5.7) over (11ubuntu5.4) ...
Setting up base-files (11ubuntu5.7) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../bash_5.0-6ubuntu1.2_amd64.deb ...
Unpacking bash (5.0-6ubuntu1.2) over (5.0-6ubuntu1.1) ...
Setting up bash (5.0-6ubuntu1.2) ...
update-alternatives: error: alternative path /usr/share/man/man7/bash-builtins.7.gz doesn't exist
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking bsdutils (1:2.34-0.1ubuntu9.4) over (1:2.34-0.1ubuntu9.1) ...
Setting up bsdutils (1:2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../tar_1.30+dfsg-7ubuntu0.20.04.3_amd64.deb ...
Unpacking tar (1.30+dfsg-7ubuntu0.20.04.3) over (1.30+dfsg-7ubuntu0.20.04.1) ...
Setting up tar (1.30+dfsg-7ubuntu0.20.04.3) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.7ubuntu3.2_amd64.deb ...
Unpacking dpkg (1.19.7ubuntu3.2) over (1.19.7ubuntu3) ...
Setting up dpkg (1.19.7ubuntu3.2) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../gzip_1.10-0ubuntu4.1_amd64.deb ...
Unpacking gzip (1.10-0ubuntu4.1) over (1.10-0ubuntu4) ...
Setting up gzip (1.10-0ubuntu4.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../login_1%3a4.8.1-1ubuntu5.20.04.4_amd64.deb ...
Unpacking login (1:4.8.1-1ubuntu5.20.04.4) over (1:4.8.1-1ubuntu5.20.04.1) ...
Setting up login (1:4.8.1-1ubuntu5.20.04.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../ncurses-bin_6.2-0ubuntu2.1_amd64.deb ...
Unpacking ncurses-bin (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Setting up ncurses-bin (6.2-0ubuntu2.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../perl-base_5.30.0-9ubuntu0.5_amd64.deb ...
Unpacking perl-base (5.30.0-9ubuntu0.5) over (5.30.0-9ubuntu0.2) ...
Setting up perl-base (5.30.0-9ubuntu0.5) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libblkid1_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking libblkid1:amd64 (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Setting up libblkid1:amd64 (2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libuuid1_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking libuuid1:amd64 (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Setting up libuuid1:amd64 (2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libfdisk1_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking libfdisk1:amd64 (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Preparing to unpack .../libmount1_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking libmount1:amd64 (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Setting up libmount1:amd64 (2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libncurses6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Preparing to unpack .../libncursesw6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncursesw6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Preparing to unpack .../libtinfo6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libtinfo6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Setting up libtinfo6:amd64 (6.2-0ubuntu2.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libsmartcols1_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking libsmartcols1:amd64 (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Setting up libsmartcols1:amd64 (2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../fdisk_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking fdisk (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Preparing to unpack .../util-linux_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking util-linux (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Setting up util-linux (2.34-0.1ubuntu9.4) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.31-0ubuntu9.14_amd64.deb ...
Unpacking libc-bin (2.31-0ubuntu9.14) over (2.31-0ubuntu9.2) ...
Setting up libc-bin (2.31-0ubuntu9.14) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../ncurses-base_6.2-0ubuntu2.1_all.deb ...
Unpacking ncurses-base (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Setting up ncurses-base (6.2-0ubuntu2.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../liblzma5_5.2.4-1ubuntu1.1_amd64.deb ...
Unpacking liblzma5:amd64 (5.2.4-1ubuntu1.1) over (5.2.4-1ubuntu1) ...
Setting up liblzma5:amd64 (5.2.4-1ubuntu1.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libsystemd0_245.4-4ubuntu3.22_amd64.deb ...
Unpacking libsystemd0:amd64 (245.4-4ubuntu3.22) over (245.4-4ubuntu3.13) ...
Setting up libsystemd0:amd64 (245.4-4ubuntu3.22) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libudev1_245.4-4ubuntu3.22_amd64.deb ...
Unpacking libudev1:amd64 (245.4-4ubuntu3.22) over (245.4-4ubuntu3.13) ...
Setting up libudev1:amd64 (245.4-4ubuntu3.22) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../zlib1g_1%3a1.2.11.dfsg-2ubuntu1.5_amd64.deb ...
Unpacking zlib1g:amd64 (1:1.2.11.dfsg-2ubuntu1.5) over (1:1.2.11.dfsg-2ubuntu1.2) ...
Setting up zlib1g:amd64 (1:1.2.11.dfsg-2ubuntu1.5) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.10_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.10) over (2.0.6) ...
Setting up libapt-pkg6.0:amd64 (2.0.10) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../gpgv_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgv (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Setting up gpgv (2.2.19-3ubuntu2.2) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libgmp10_2%3a6.2.0+dfsg-4ubuntu0.1_amd64.deb ...
Unpacking libgmp10:amd64 (2:6.2.0+dfsg-4ubuntu0.1) over (2:6.2.0+dfsg-4) ...
Setting up libgmp10:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libgnutls30_3.6.13-2ubuntu1.9_amd64.deb ...
Unpacking libgnutls30:amd64 (3.6.13-2ubuntu1.9) over (3.6.13-2ubuntu1.6) ...
Setting up libgnutls30:amd64 (3.6.13-2ubuntu1.9) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../libseccomp2_2.5.1-1ubuntu1~20.04.2_amd64.deb ...
Unpacking libseccomp2:amd64 (2.5.1-1ubuntu1~20.04.2) over (2.5.1-1ubuntu1~20.04.1) ...
Setting up libseccomp2:amd64 (2.5.1-1ubuntu1~20.04.2) ...
(Reading database ... 4345 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.10_amd64.deb ...
Unpacking apt (2.0.10) over (2.0.6) ...
Setting up apt (2.0.10) ...
Removing obsolete conffile /etc/kernel/postinst.d/apt-auto-removal ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libpam0g_1.3.1-5ubuntu4.6_amd64.deb ...
Unpacking libpam0g:amd64 (1.3.1-5ubuntu4.6) over (1.3.1-5ubuntu4.3) ...
Setting up libpam0g:amd64 (1.3.1-5ubuntu4.6) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libpam-modules-bin_1.3.1-5ubuntu4.6_amd64.deb ...
Unpacking libpam-modules-bin (1.3.1-5ubuntu4.6) over (1.3.1-5ubuntu4.3) ...
Setting up libpam-modules-bin (1.3.1-5ubuntu4.6) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libpam-modules_1.3.1-5ubuntu4.6_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Unpacking libpam-modules:amd64 (1.3.1-5ubuntu4.6) over (1.3.1-5ubuntu4.3) ...
Setting up libpam-modules:amd64 (1.3.1-5ubuntu4.6) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../logsave_1.45.5-2ubuntu1.1_amd64.deb ...
Unpacking logsave (1.45.5-2ubuntu1.1) over (1.45.5-2ubuntu1) ...
Preparing to unpack .../libext2fs2_1.45.5-2ubuntu1.1_amd64.deb ...
Unpacking libext2fs2:amd64 (1.45.5-2ubuntu1.1) over (1.45.5-2ubuntu1) ...
Setting up libext2fs2:amd64 (1.45.5-2ubuntu1.1) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../e2fsprogs_1.45.5-2ubuntu1.1_amd64.deb ...
Unpacking e2fsprogs (1.45.5-2ubuntu1.1) over (1.45.5-2ubuntu1) ...
Preparing to unpack .../mount_2.34-0.1ubuntu9.4_amd64.deb ...
Unpacking mount (2.34-0.1ubuntu9.4) over (2.34-0.1ubuntu9.1) ...
Preparing to unpack .../libpam-runtime_1.3.1-5ubuntu4.6_all.deb ...
Unpacking libpam-runtime (1.3.1-5ubuntu4.6) over (1.3.1-5ubuntu4.3) ...
Setting up libpam-runtime (1.3.1-5ubuntu4.6) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.34-7ubuntu0.1_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.34-7ubuntu0.1) over (10.34-7) ...
Setting up libpcre2-8-0:amd64 (10.34-7ubuntu0.1) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.39-12ubuntu0.1_amd64.deb ...
Unpacking libpcre3:amd64 (2:8.39-12ubuntu0.1) over (2:8.39-12build1) ...
Setting up libpcre3:amd64 (2:8.39-12ubuntu0.1) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libsepol1_3.0-1ubuntu0.1_amd64.deb ...
Unpacking libsepol1:amd64 (3.0-1ubuntu0.1) over (3.0-1) ...
Setting up libsepol1:amd64 (3.0-1ubuntu0.1) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../passwd_1%3a4.8.1-1ubuntu5.20.04.4_amd64.deb ...
Unpacking passwd (1:4.8.1-1ubuntu5.20.04.4) over (1:4.8.1-1ubuntu5.20.04.1) ...
Setting up passwd (1:4.8.1-1ubuntu5.20.04.4) ...
(Reading database ... 4342 files and directories currently installed.)
Preparing to unpack .../libcom-err2_1.45.5-2ubuntu1.1_amd64.deb ...
Unpacking libcom-err2:amd64 (1.45.5-2ubuntu1.1) over (1.45.5-2ubuntu1) ...
Preparing to unpack .../libprocps8_2%3a3.3.16-1ubuntu2.4_amd64.deb ...
Unpacking libprocps8:amd64 (2:3.3.16-1ubuntu2.4) over (2:3.3.16-1ubuntu2.3) ...
Preparing to unpack .../libss2_1.45.5-2ubuntu1.1_amd64.deb ...
Unpacking libss2:amd64 (1.45.5-2ubuntu1.1) over (1.45.5-2ubuntu1) ...
Preparing to unpack .../procps_2%3a3.3.16-1ubuntu2.4_amd64.deb ...
Unpacking procps (2:3.3.16-1ubuntu2.4) over (2:3.3.16-1ubuntu2.3) ...
Setting up libcom-err2:amd64 (1.45.5-2ubuntu1.1) ...
Setting up libncurses6:amd64 (6.2-0ubuntu2.1) ...
Setting up libss2:amd64 (1.45.5-2ubuntu1.1) ...
Setting up libncursesw6:amd64 (6.2-0ubuntu2.1) ...
Setting up logsave (1.45.5-2ubuntu1.1) ...
Setting up libfdisk1:amd64 (2.34-0.1ubuntu9.4) ...
Setting up mount (2.34-0.1ubuntu9.4) ...
Setting up libprocps8:amd64 (2:3.3.16-1ubuntu2.4) ...
Setting up e2fsprogs (1.45.5-2ubuntu1.1) ...
Setting up fdisk (2.34-0.1ubuntu9.4) ...
Setting up procps (2:3.3.16-1ubuntu2.4) ...
Processing triggers for libc-bin (2.31-0ubuntu9.14) ...
root@12adcd8f7dd9:/#
  1. 安裝IP工具包
root@12adcd8f7dd9:/# apt install -y iproute2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:libatm1 libbsd0 libcap2 libcap2-bin libelf1 libmnl0 libpam-cap libxtables12
Suggested packages:iproute2-doc
The following NEW packages will be installed:iproute2 libatm1 libbsd0 libcap2 libcap2-bin libelf1 libmnl0 libpam-cap libxtables12
0 upgraded, 9 newly installed, 0 to remove and 51 not upgraded.
Need to get 1061 kB of archives.
After this operation, 3682 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libbsd0 amd64 0.10.0-1 [45.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcap2 amd64 1:2.32-1ubuntu0.1 [15.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libelf1 amd64 0.176-1.1ubuntu0.1 [44.2 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libmnl0 amd64 1.0.4-2 [12.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxtables12 amd64 1.8.4-3ubuntu2.1 [28.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcap2-bin amd64 1:2.32-1ubuntu0.1 [26.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 iproute2 amd64 5.5.0-1ubuntu1 [858 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 libatm1 amd64 1:2.5.1-4 [21.8 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam-cap amd64 1:2.32-1ubuntu0.1 [8364 B]
Fetched 1061 kB in 6s (177 kB/s)    
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libbsd0:amd64.
(Reading database ... 4127 files and directories currently installed.)
Preparing to unpack .../0-libbsd0_0.10.0-1_amd64.deb ...
Unpacking libbsd0:amd64 (0.10.0-1) ...
Selecting previously unselected package libcap2:amd64.
Preparing to unpack .../1-libcap2_1%3a2.32-1ubuntu0.1_amd64.deb ...
Unpacking libcap2:amd64 (1:2.32-1ubuntu0.1) ...
Selecting previously unselected package libelf1:amd64.
Preparing to unpack .../2-libelf1_0.176-1.1ubuntu0.1_amd64.deb ...
Unpacking libelf1:amd64 (0.176-1.1ubuntu0.1) ...
Selecting previously unselected package libmnl0:amd64.
Preparing to unpack .../3-libmnl0_1.0.4-2_amd64.deb ...
Unpacking libmnl0:amd64 (1.0.4-2) ...
Selecting previously unselected package libxtables12:amd64.
Preparing to unpack .../4-libxtables12_1.8.4-3ubuntu2.1_amd64.deb ...
Unpacking libxtables12:amd64 (1.8.4-3ubuntu2.1) ...
Selecting previously unselected package libcap2-bin.
Preparing to unpack .../5-libcap2-bin_1%3a2.32-1ubuntu0.1_amd64.deb ...
Unpacking libcap2-bin (1:2.32-1ubuntu0.1) ...
Selecting previously unselected package iproute2.
Preparing to unpack .../6-iproute2_5.5.0-1ubuntu1_amd64.deb ...
Unpacking iproute2 (5.5.0-1ubuntu1) ...
Selecting previously unselected package libatm1:amd64.
Preparing to unpack .../7-libatm1_1%3a2.5.1-4_amd64.deb ...
Unpacking libatm1:amd64 (1:2.5.1-4) ...
Selecting previously unselected package libpam-cap:amd64.
Preparing to unpack .../8-libpam-cap_1%3a2.32-1ubuntu0.1_amd64.deb ...
Unpacking libpam-cap:amd64 (1:2.32-1ubuntu0.1) ...
Setting up libatm1:amd64 (1:2.5.1-4) ...
Setting up libcap2:amd64 (1:2.32-1ubuntu0.1) ...
Setting up libcap2-bin (1:2.32-1ubuntu0.1) ...
Setting up libmnl0:amd64 (1.0.4-2) ...
Setting up libxtables12:amd64 (1.8.4-3ubuntu2.1) ...
Setting up libbsd0:amd64 (0.10.0-1) ...
Setting up libelf1:amd64 (0.176-1.1ubuntu0.1) ...
Setting up libpam-cap:amd64 (1:2.32-1ubuntu0.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up iproute2 (5.5.0-1ubuntu1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
root@12adcd8f7dd9:/# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft forever
6: eth0@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0valid_lft forever preferred_lft forever
root@12adcd8f7dd9:/# 

我們的ip命令就可以正常使用了

終止容器

[root@docker ~]# docker ps -all #現在是啟動中的容器狀態Up 6 seconds
CONTAINER ID   IMAGE     COMMAND   CREATED          STATUS         PORTS     NAMES
12adcd8f7dd9   ubuntu    "bash"    19 minutes ago   Up 6 seconds             optimistic_jackson
[root@docker ~]# docker stop 12adcd8f7dd9 #現在是停止容器
12adcd8f7dd9
[root@docker ~]# docker ps -all  #現在是停止容器  Exited (0) 2 seconds ago
CONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                     PORTS     NAMES
12adcd8f7dd9   ubuntu    "bash"    20 minutes ago   Exited (0) 2 seconds ago             optimistic_jackson
[root@docker ~]# 

進入容器

使用-d參數運行容器時,容器啟動后會進入后臺。此時想要進入容器,可以通過以下指令進入:
● docker attach:使用這個命令進入容器,退出時會導致容器停止。
● docker exec:推薦大家使用docker exec命令,因為此命令會退出容器終端,但不會導致容器的停止。

docker attach

[root@docker ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED         STATUS         PORTS     NAMES
3deae30b2ec7   ubuntu    "bash"    5 seconds ago   Up 4 seconds             hungry_merkle
[root@docker ~]# docker attach 3deae30b2ec7
root@3deae30b2ec7:/# exit
exit
[root@docker ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@docker ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                      PORTS     NAMES
3deae30b2ec7   ubuntu    "bash"    4 minutes ago    Exited (0) 37 seconds ago             hungry_merkle
12adcd8f7dd9   ubuntu    "bash"    27 minutes ago   Exited (0) 7 minutes ago              optimistic_jackson

我們發現容器會停止,我們再次啟動容器使用 crtl+p+q 退出

[root@docker ~]# docker start 3deae30b2ec7
3deae30b2ec7
[root@docker ~]# docker attach 3deae30b2ec7
root@3deae30b2ec7:/# read escape sequence
[root@docker ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                     PORTS     NAMES
3deae30b2ec7   ubuntu    "bash"    6 minutes ago    Up 26 seconds                        hungry_merkle
12adcd8f7dd9   ubuntu    "bash"    28 minutes ago   Exited (0) 8 minutes ago             optimistic_jackson
[root@docker ~]# 

容器是正常運行的

docker exec

[root@docker ~]# docker exec -it 3deae30b2ec7 /bin/bash
root@3deae30b2ec7:/#  exit
exit
[root@docker ~]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED          STATUS                      PORTS     NAMES
3deae30b2ec7   ubuntu    "bash"    23 minutes ago   Up 18 minutes                         hungry_merkle
12adcd8f7dd9   ubuntu    "bash"    46 minutes ago   Exited (0) 26 minutes ago             optimistic_jackson
[root@docker ~]# 

注意: 使用docker exec進入容器,如果從這個容器退出,容器不會停止,因此推薦使用docker exec。

導出和導入

導出

如果要導出本地某個容器,可以使用 docker export 命令。為以后我們不需要重復安裝ip命令做準備
例如,導出容器 3deae30b2ec7快照到本地文件 ubuntu.tar:

[root@docker ~]# docker export 3deae30b2ec7 > ubuntu.tar
[root@docker ~]# ls -l
總用量 73404
-rw-------. 1 root root     1323 1121 15:44 anaconda-ks.cfg
-rw-r--r--. 1 root root 75158528 129 11:20 ubuntu.tar
[root@docker ~]# 

導入

可以使用 docker import 從本地容器快照文件中再導入為鏡像,以下實例將快照文件 ubuntu.tar 導入到鏡像 test/ubuntu:v1:

[root@docker ~]# docker import ubuntu.tar circle/ubuntu:1.0
sha256:34035f46d2c6227f66338127ef939b7757b115f4d2a485fc06f84971604da062
[root@docker ~]# docker images
REPOSITORY           TAG                 IMAGE ID       CREATED         SIZE
circle/ubuntu        1.0                 34035f46d2c6   6 seconds ago   72.8MB
circledba/kingbase   v008r006c007b0024   df101ff5974d   41 hours ago    12.4GB
tomcat               latest              fb5657adc892   23 months ago   680MB
ubuntu               latest              ba6acccedd29   2 years ago     72.8MB
centos               7                   eeb6ee3f44bd   2 years ago     204MB
[root@docker ~]# 

還可以通過指定 URL 或者某個目錄來導入,例如:
docker import http://example.com/exampleimage.tgz example/imagerepo

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/209315.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/209315.shtml
英文地址,請注明出處:http://en.pswp.cn/news/209315.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

淺談5G基站節能及數字化管理解決方案的設計與應用-安科瑞 蔣靜

截至2023年10月&#xff0c;我國5G基站總數達321.5萬個&#xff0c;占全國通信基站總數的28.1%。然而&#xff0c;隨著5G基站數量的快速增長&#xff0c;基站的能耗問題也逐漸日益凸顯&#xff0c;基站的用電給運營商帶來了巨大的電費開支壓力&#xff0c;降低5G基站的能耗成為…

actitivi自定義屬性(二)

聲明&#xff1a;此處activiti版本為6.0 此文章介紹后端自定義屬性解析&#xff0c;前端添加自定義屬性方法連接&#xff1a;activiti自定義屬性&#xff08;一&#xff09;_ruoyi activiti自定義標題-CSDN博客 1、涉及到的類如下&#xff1a; 簡介&#xff1a;DefaultXmlPar…

在 JavaScript 中導入和導出 Excel XLSX 文件:SpreadJS

在 JavaScript 中導入和導出 Excel XLSX 文件 2023 年 12 月 5 日 使用 MESCIUS 的 SpreadJS 將完整的 JavaScript 電子表格添加到您的企業應用程序中。 SpreadJS 是一個完整的企業 JavaScript 電子表格解決方案&#xff0c;用于創建財務報告和儀表板、預算和預測模型、科學、工…

【華為OD】給定一個只包括 ‘(‘,‘)‘,‘{‘,‘}‘,‘[‘,‘]‘ 的字符串

給定一個只包括 (,),{,},[,] 的字符串 s , 判斷字符串是否有效。 有效字符串需滿足: 左括號必須用相同類型的右括號閉合。 左括號必須以正確的順序閉合。 示例 1 : 輸入:s="()" 輸出 : true 示例 2 :

圖的搜索(一):廣度優先搜索算法和深度優先搜索算法

圖的搜索&#xff08;一&#xff09;&#xff1a;廣度優先搜索算法和深度優先搜索算法 本章主要記錄了圖的搜索算法&#xff0c;和可以解決圖的基本問題——最短路徑問題的算法。本章主要對圖搜索的相關算法進行了介紹&#xff1a;廣度優先搜索算法、深度優先搜索算法。 下一…

公網域名如何解析到內網IP服務器——快解析域名映射外網訪問

在本地搭建主機應用后&#xff0c;由于沒有公網IP或沒有公網路由權限&#xff0c;在需要發布互聯網時&#xff0c;就需要用到外網訪問內網的一些方案。由于內網IP在外網不能直接訪問&#xff0c;通常就用通過外網域名來訪問內網的方法。那么&#xff0c;公網域名如何解析到內網…

Tmux中使用Docker報錯 - 解決方案

問題 進入Tmux會話后&#xff0c;在其中使用Docker可能會出現如下報錯&#xff1a; Got permission denied while trying to connect to the Docker ……解決方案 退出tmux會話: tmux detach在tmux會話外部殺掉tmux進程&#xff1a; pkill -f tmux重新進入tmux&#xff1a…

權威認證!景聯文科技入選杭州市2023年第二批省級“專精特新”中小企業認定名單

為深入貫徹黨中央國務院和省委省政府培育專精特新的決策部署&#xff0c;10月7日&#xff0c;杭州市經濟和信息化委員會公示了2023年杭州“專精特新”企業名單&#xff08;第二批&#xff09;。 根據工業和信息化部《優質中小企業梯度培育管理暫行辦法》&#xff08;工信部企業…

【Vue3+Ts項目】硅谷甄選 — 路由配置+登錄模塊+layout組件+路由鑒權

一、路由配置 項目一共需要4個一級路由&#xff1a;登錄&#xff08;login&#xff09;、主頁&#xff08;home&#xff09;、404、任意路由&#xff08;重定向到404&#xff09;。 1.1 安裝路由插件 pnpm install vue-router 1.2 創建路由組件 在src目錄下新建views文件…

Graphpad Prism10.1.0 安裝教程 (含Win/Mac版)

GraphPad Prism GraphPad Prism是一款非常專業強大的科研醫學生物數據處理繪圖軟件&#xff0c;它可以將科學圖形、綜合曲線擬合&#xff08;非線性回歸&#xff09;、可理解的統計數據、數據組織結合在一起&#xff0c;除了最基本的數據統計分析外&#xff0c;還能自動生成統…

Python:核心知識點整理大全8-筆記

目錄 ?編輯 4.5 元組 4.5.1 定義元組 dimensions.py 4.5.2 遍歷元組中的所有值 4.5.3 修改元組變量 4.6 設置代碼格式 4.6.1 格式設置指南 4.6.2 縮進 4.6.3 行長 4.6.4 空行 4.6.5 其他格式設置指南 4.7 小結 第5章 if語句 5.1 一個簡單示例 cars.py 5.2 條…

現代皮質沙發模型材質編輯

在線工具推薦&#xff1a; 3D數字孿生場景編輯器 - GLTF/GLB材質紋理編輯器 - 3D模型在線轉換 - Three.js AI自動紋理開發包 - YOLO 虛幻合成數據生成器 - 三維模型預覽圖生成器 - 3D模型語義搜索引擎 當談到游戲角色的3D模型風格時&#xff0c;有幾種不同的風格&#xf…

線性容器(QByteArray、QString、QList模板類)、堆棧窗體

QT 線性容器 點擊查看&#xff1a;字符和字節的區別&#xff0c;ASCII、Unicode 和 UTF-8 編碼的區別。&#xff08;&#x1f448; 安全鏈接&#xff0c;放心跳轉&#xff09; QByteArray 思考&#xff1a;char buf[6] “hello”; 如果 C 語言中要利用 buf 內容重新生成 “…

學生備考使用臺燈到底好不好?公認好用的護眼臺燈推薦

在現代生活中&#xff0c;許多學生的學習壓力越來越大&#xff0c;面臨的近視幾率也越來越大&#xff0c;特別是初中生&#xff0c;眼睛發育還未完全&#xff0c;使用不恰當的燈光也會對眼睛造成損害&#xff0c;特別是護眼臺燈。雖然護眼臺燈在功能上能夠提供充足、柔和的光線…

harbor倉庫鏡像遷移腳本

import subprocess import json import logging# 配置日志 logging.basicConfig(levellogging.INFO, format%(asctime)s - %(levelname)s - %(message)s)# 替換這里的Harbor倉庫地址和憑據 harbor_url "https://harbor.test.com" harbor_name "harbor.test.co…

《文存閱刊》期刊發表簡介

《文存閱刊》以“深研文化創新&#xff0c;崇尚科學真理&#xff0c;堅持雙百方針&#xff0c;打造學術精品”為辦刊宗旨&#xff0c;涵蓋藝術、文學、社科等多項內容&#xff0c;適應了文化市場需求&#xff0c;很好的回應了廣大文化理論工作者的關切&#xff0c;為下一步打造…

ChatGPT新媒體運營神器:輕松駕馭內容創作與傳播

文章目錄 1. 內容創作2. 社交媒體管理3. 用戶互動與客戶服務 《巧用ChatGPT輕松玩轉新媒體運營》內容簡介作者簡介目錄前言/序言本書內容本書特色本書讀者對象獲取方式 隨著互聯網的高速發展&#xff0c;新媒體已經成為了人們獲取信息、交流思想的重要渠道。在這個信息爆炸的時…

【SpringCache】快速入門 通俗易懂

1. 介紹 Spring Cache 是一個框架&#xff0c;實現了基于注解的緩存功能&#xff0c;只需要簡單地加一個注解&#xff0c;就能實現緩存功能。 Spring Cache 提供了一層抽象&#xff0c;底層可以切換不同的緩存實現&#xff0c;例如&#xff1a; EHCache Caffeine Redis(常用…

Centos7、Mysql8.0 load_file函數返回為空的終極解決方法--暨selinux的深入理解

零、問題背景 最近想換房&#xff0c;為了方便自己對比感興趣的房子&#xff0c;因此決定將目標房源的基本信息放在表里&#xff0c;特別是要一目了然的看到眾多房子的各種圖紙和照片&#xff0c;因此決定要在Mysql8.0.34數據庫中以二進制形式保存圖片&#xff08;拋開合理性和…

喝酒誰先倒

劃拳是古老中國酒文化的一個有趣的組成部分。酒桌上兩人劃拳的方法為&#xff1a;每人口中喊出一個數字&#xff0c;同時用手比劃出一個數字。如果誰比劃出的數字正好等于兩人喊出的數字之和&#xff0c;誰就輸了&#xff0c;輸家罰一杯酒。兩人同贏或兩人同輸則繼續下一輪&…