美文网首页
openSUSE docker 安装

openSUSE docker 安装

作者: liurongming | 来源:发表于2017-12-17 18:57 被阅读0次

系统要求

对于openSUSE 安装docker 建议将系统版本调整到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 '主更新源 (调试)' 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...

启动并查看

可以采用两种方式进行启动和查看,分别为以下情况:
第一种方式,传统的方式

systemctl start docker 
systemctl status docker

第二种方式,当前流行方式

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:~ # 

操作结果

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:~ # 

开机自启动

chkconfig docker on
或者
systemctl enable docker

相关文章

网友评论

      本文标题:openSUSE docker 安装

      本文链接:https://www.haomeiwen.com/subject/pukuwxtx.html