Ubuntu 18 中安装Docker
安装Docker 输入命令:apt install docker.io -y
root@ubuntu:/home/hui# apt install docker.io -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
bridge-utils cgroupfs-mount git git-man liberror-perl pigz ubuntu-fan
Suggested packages:
aufs-tools btrfs-progs debootstrap docker-doc rinse zfs-fuse | zfsutils git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
bridge-utils cgroupfs-mount docker.io git git-man liberror-perl pigz ubuntu-fan
0 upgraded, 8 newly installed, 0 to remove and 296 not upgraded.
Need to get 45.0 MB of archives.
After this operation, 232 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 pigz amd64 2.4 -1 [57.4 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 bridge-utils amd64 1.5 -15 ubuntu1 [30.1 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 cgroupfs-mount all 1.4 [6 ,320 B]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 docker.io amd64 18.06 .1 -0 ubuntu1~18.04 .1 [40.2 MB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 docker.io amd64 18.06 .1 -0 ubuntu1~18.04 .1 [40.2 MB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 docker.io amd64 18.06 .1 -0 ubuntu1~18.04 .1 [40.2 MB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 liberror-perl all 0.17025 -1 [22.8 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 git-man all 1 :2.17 .1 -1 ubuntu0.3 [803 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 git amd64 1 :2.17 .1 -1 ubuntu0.3 [3 ,898 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 ubuntu-fan all 0.12 .10 [34.7 kB]
Fetched 11.8 MB in 11 min 43 s (16.7 kB/s)
Preconfiguring packages ...
Selecting previously unselected package pigz.
(Reading database ... 128796 files and directories currently installed.)
Preparing to unpack .../0 -pigz_2.4 -1 _amd64.deb ...
Unpacking pigz (2.4 -1 ) ...
Selecting previously unselected package bridge-utils.
Preparing to unpack .../1 -bridge-utils_1.5 -15 ubuntu1_amd64.deb ...
Unpacking bridge-utils (1.5 -15 ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2 -cgroupfs-mount_1.4 _all.deb ...
Unpacking cgroupfs-mount (1.4 ) ...
Selecting previously unselected package docker.io.
Preparing to unpack .../3 -docker.io_18.06.1 -0 ubuntu1~18.04 .1 _amd64.deb ...
Unpacking docker.io (18.06 .1 -0 ubuntu1~18.04 .1 ) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../4 -liberror-perl_0.17025 -1 _all.deb ...
Unpacking liberror-perl (0.17025 -1 ) ...
Selecting previously unselected package git-man.
Preparing to unpack .../5 -git-man_1
Unpacking git-man (1 :2.17 .1 -1 ubuntu0.3 ) ...
Selecting previously unselected package git.
Preparing to unpack .../6 -git_1
Unpacking git (1 :2.17 .1 -1 ubuntu0.3 ) ...
Selecting previously unselected package ubuntu-fan.
Preparing to unpack .../7 -ubuntu-fan_0.12.10 _all.deb ...
Unpacking ubuntu-fan (0.12 .10 ) ...
Setting up git-man (1 :2.17 .1 -1 ubuntu0.3 ) ...
Setting up docker.io (18.06 .1 -0 ubuntu1~18.04 .1 ) ...
Adding group `docker' (GID 127 ) ...
Done.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket 鈫/lib/systemd/system/docker.socket.
Processing triggers for ureadahead (0.100 .0 -20 ) ...
Setting up liberror-perl (0.17025 -1 ) ...
Setting up cgroupfs-mount (1.4 ) ...
Setting up bridge-utils (1.5 -15 ubuntu1) ...
Setting up ubuntu-fan (0.12 .10 ) ...
Created symlink /etc/systemd/system/multi-user.target.wants/ubuntu-fan.service 鈫/lib/systemd/system/ubuntu-fan.service.
Processing triggers for systemd (237 -3 ubuntu10.3 ) ...
Processing triggers for man-db (2.8 .3 -2 ) ...
Setting up pigz (2.4 -1 ) ...
Setting up git (1 :2.17 .1 -1 ubuntu0.3 ) ...
Processing triggers for ureadahead (0.100 .0 -20 ) ...
查看Docker安装信息
查看Docker版本,命令:docker version
root@ubuntu:/home/hui# docker version
Client:
Version: 18.06 .1 -ce
API version: 1.38
Go version: go1.10.4
Git commit: e68fc7a
Built: Fri Oct 19 19 :43:14 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06 .1 -ce
API version: 1.38 (minimum version 1.12 )
Go version: go1.10.4
Git commit: e68fc7a
Built: Thu Sep 27 02 :39:50 2018
OS/Arch: linux/amd64
Experimental: false
查看Docker运行信息,命令: docker info
root@ubuntu :/home/hui# docker info
Containers : 2
Running : 1
Paused : 0
Stopped : 1
Images : 1
Server Version : 18.06 .1 -ce
Storage Driver : overlay2
Backing Filesystem : extfs
Supports d_type : true
Native Overlay Diff : true
Logging Driver : json-file
Cgroup Driver : cgroupfs
Plugins :
Volume : local
Network : bridge host macvlan null overlay
Log : awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm : inactive
Runtimes : runc
Default Runtime : runc
Init Binary : docker-init
containerd version : (expected : 468 a545b9edcd5932818eb9de8e72413e616e86e)
runc version : N/A (expected : 69663 f0bd4b60df09991c08812a60108003fa340)
init version : v0.18.0 (expected : fec3683b971d9c3ef73f284f176672c44b448662)
Security Options :
apparmor
seccomp
Profile : default
Kernel Version : 4.15 .0 -29 -generic
Operating System : Ubuntu 18.04 .1 LTS
OSType : linux
Architecture : x86_64
CPUs : 1
Total Memory : 1.924 GiB
Name : ubuntu
ID : R2AB :BQWA :UHTP :523 R :7 VDY :ZHZV :VZQK :OLF7:2 PN4:FTGX :EO72:URDZ
Docker Root Dir : /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry : https ://index.docker.io/v1/
Labels :
Experimental : false
Insecure Registries :
127.0 .0.0 /8
Live Restore Enabled : false
WARNING : No swap limit support
检查安装是否正确, 命令:docker run hello-world
root@ubuntu:/home/hui# docker run hello-world
Unable to find image 'he llo-world:latest' locally
latest: Pulling from library /hello-world
d1725b59e92d: Pull complete
Digest: sha256:0 add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1 . The Docker client contacted the Docker daemon.
2 . The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3 . The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4 . The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with :
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https:
For more examples and ideas, visit:
https:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了