系統(tǒng)要求
對(duì)于openSUSE 安裝docker 建議將系統(tǒng)版本調(diào)整到openSUSE,這樣可以省去安裝虛擬化倉庫,及不必要的操作步驟想际。
linux-sue:~ # uname -a
Linux linux-sue 3.16.6-2-desktop #1 SMP PREEMPT Mon Oct 20 13:47:22 UTC 2014 (feb42ea) x86_64 x86_64 x86_64 GNU/Linux
linux-sue:~ #
命令安裝
zypper install docker
linux-sue:~ # zypper install docker
Retrieving repository 'openSUSE-13.2-Update' metadata ..................................................................................................................................[error]
Repository 'openSUSE-13.2-Update' is invalid.
[repo-update|http://download.opensuse.org/update/13.2/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Disabling repository 'openSUSE-13.2-Update' because of the above error.
Retrieving repository 'openSUSE-13.2-Update-Non-Oss' metadata ..........................................................................................................................[error]
Repository 'openSUSE-13.2-Update-Non-Oss' is invalid.
[repo-update-non-oss|http://download.opensuse.org/update/13.2-non-oss/] Valid metadata not found at specified URL
Please check if the URIs defined for this repository are pointing to a valid repository.
Disabling repository 'openSUSE-13.2-Update-Non-Oss' because of the above error.
Loading repository data...
Warning: Repository '主更新源 (調(diào)試)' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...
Resolving package dependencies...
The following 6 NEW packages are going to be installed:
bridge-utils docker git-core git-gui gitk perl-Error
6 new packages to install.
Overall download size: 6.4 MiB. Already cached: 0 B After the operation, additional 32.9 MiB will be used.
Continue? [y/n/? shows all options] (y): y
Retrieving package perl-Error-0.17022-2.1.3.noarch (1/6), 34.9 KiB ( 70.0 KiB unpacked)
Retrieving: perl-Error-0.17022-2.1.3.noarch.rpm .........................................................................................................................................[done]
Retrieving package bridge-utils-1.5-18.1.2.x86_64 (2/6), 32.0 KiB ( 66.0 KiB unpacked)
Retrieving: bridge-utils-1.5-18.1.2.x86_64.rpm ..........................................................................................................................................[done]
Retrieving package git-core-2.1.2-2.1.x86_64 (3/6), 2.7 MiB ( 14.0 MiB unpacked)
Retrieving: git-core-2.1.2-2.1.x86_64.rpm .................................................................................................................................[done (204.9 KiB/s)]
Retrieving package gitk-2.1.2-2.1.x86_64 (4/6), 192.4 KiB (688.6 KiB unpacked)
Retrieving: gitk-2.1.2-2.1.x86_64.rpm ...................................................................................................................................................[done]
Retrieving package git-gui-2.1.2-2.1.x86_64 (5/6), 264.2 KiB ( 1.2 MiB unpacked)
Retrieving: git-gui-2.1.2-2.1.x86_64.rpm ..................................................................................................................................[done (101.1 KiB/s)]
Retrieving package docker-1.2.0-2.8.x86_64 (6/6), 3.2 MiB ( 16.9 MiB unpacked)
Retrieving: docker-1.2.0-2.8.x86_64.rpm ...................................................................................................................................[done (392.1 KiB/s)]
Checking for file conflicts: ............................................................................................................................................................[done]
(1/6) Installing: perl-Error-0.17022-2.1.3 ..............................................................................................................................................[done]
(2/6) Installing: bridge-utils-1.5-18.1.2 ...............................................................................................................................................[done]
(3/6) Installing: git-core-2.1.2-2.1 ....................................................................................................................................................[done]
(4/6) Installing: gitk-2.1.2-2.1 ........................................................................................................................................................[done]
(5/6) Installing: git-gui-2.1.2-2.1 .....................................................................................................................................................[done]
(6/6) Installing: docker-1.2.0-2.8 ......................................................................................................................................................[done]
Additional rpm output:
creating group docker...
Updating /etc/sysconfig/docker...
啟動(dòng)并查看
可以采用兩種方式進(jìn)行啟動(dòng)和查看,分別為以下情況:
第一種方式,傳統(tǒng)的方式
systemctl start docker
systemctl status docker
第二種方式饰剥,當(dāng)前流行方式
service docker status
service docker start
linux-sue:~ # service docker
Usage: /sbin/service docker {start|stop|reload|restart|try-restart|force-reload|status}
linux-sue:~ #
操作結(jié)果
linux-sue:~ # systemctl start docker
linux-sue:~ # systemctl status docker
docker.service - Docker
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
Active: active (running) since Sun 2017-12-17 18:32:00 CST; 5s ago
Main PID: 3220 (docker)
CGroup: /system.slice/docker.service
└─3220 /usr/bin/docker -d
Dec 17 18:32:00 linux-sue docker[3220]: [info] Listening for HTTP on unix (/var/run/docker.sock)
Dec 17 18:32:00 linux-sue docker[3220]: [2f1823b2] +job init_networkdriver()
Dec 17 18:32:00 linux-sue docker[3220]: [2f1823b2.init_networkdriver()] creating new bridge for docker0
Dec 17 18:32:01 linux-sue docker[3220]: [2f1823b2.init_networkdriver()] getting iface addr
Dec 17 18:32:01 linux-sue docker[3220]: [2f1823b2] -job init_networkdriver() = OK (0)
Dec 17 18:32:01 linux-sue docker[3220]: 2017/12/17 18:32:01 WARNING: Your kernel does not support cgroup swap limit.
Dec 17 18:32:01 linux-sue docker[3220]: [info] Loading containers:
Dec 17 18:32:01 linux-sue docker[3220]: [info] : done.
Dec 17 18:32:01 linux-sue docker[3220]: [2f1823b2] +job acceptconnections()
Dec 17 18:32:01 linux-sue docker[3220]: [2f1823b2] -job acceptconnections() = OK (0)
linux-sue:~ #
開機(jī)自啟動(dòng)
chkconfig docker on
或者
systemctl enable docker