Docker 支持 openSUSE 12.3 或更高版本。由于 Docker 的限制,Docker 只能運行在64位的主機上。
Docker 不被包含在 openSUSE 12.3 和 openSUSE 13.1 的官方鏡像倉庫中。因此需要添加 OBS 的?[虛擬化倉庫](https://build.opensuse.org/project/show/Virtualization "Virtualization repository ")?來安裝`docker`?包
執行下邊的命令來添加虛擬化倉庫(Virtualization repository):
~~~
# openSUSE 12.3
$ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_12.3/ Virtualization
# openSUSE 13.1
$ sudo zypper ar -f http://download.opensuse.org/repositories/Virtualization/openSUSE_13.1/ Virtualization
~~~
在 openSUSE 13.2版本以后就不需要添加額外的庫了。
### SUSE Linux Enterprise
可以在 SUSE Linux Enterprise 12 或 更高版本上來運行 Docker 。這里需要注意的是由于 Docker 當前的限制,只能在**64位**的主機上運行。
## 安裝
安裝 Docker 包
~~~
$ sudo zypper in docker
~~~
現在已經安裝完畢,讓我們來啟動 docker 進程
~~~
$ sudo systemctl start docker
~~~
設置開機啟動 docker:
~~~
$ sudo systemctl enable docker
~~~
Docker 包會創建一個的叫?`docker`?的群組 ,如果想使用非 root 用戶來運行,這個用戶需要是?`docker`?群組的成員才可以與 docker 進程進行交互,你可以使用如下命令添加用戶:
~~~
$ sudo usermod -a -G docker <username>
~~~
確認一切都是否按照預期工作:
~~~
$ sudo docker run --rm -i -t opensuse /bin/bash
~~~
這條命令將下載和導入?`opensuse`?鏡像,并且在容器內運行 bash,輸入 exit 來退出容器。
如果你想要你的容器能夠訪問外部的網絡,你就需要開啟?`net.ipv4.ip_forward`?規則。這里你可以使用 YaST 工具查找 Network Devices -> Network Settings -> Routing 按鈕來確認 IPv4 Forwarding 選擇框是否被選中。
當由 Network Manager 來管理網絡的時候,就不能按照上邊的方法設置了。這里我們需要手動的編輯`/etc/sysconfig/SuSEfirewall2`?文件來確保?`FW_ROUTE`?被設置成?`yes`,如下:
~~~
FW_ROUTE="yes"
~~~
## 自定義進程選項
如果你想要添加一個 HTTP 代理,為 Docker 運行文件設置不同的目錄或分區,又或者定制一些其它的功能,請閱讀我們的系統文章,了解[如何定制 Docker 進程](https://github.com/widuu/chinese_docker/blob/master/articles/systemd.md)
## 下一步
閱讀[用戶指南](39727)。
- 關于Docker
- 鏡像簡介
- 安裝篇
- Mac OS X
- Ubuntu
- Red Hat Enterprise Linux
- CentOS
- Debain
- Gentoo
- Google Cloud Platform
- Rackspace Cloud
- Amazon EC2
- IBM Softlayer
- Arch Linux
- FrugalWare
- Fedora
- openSUSE
- CRUX Linux
- Microsoft Windows
- Binaries
- 用戶指南
- 使用Docker Hub
- 在Docker中運行應用
- 使用容器
- 使用docker鏡像
- 連接容器
- 管理容器數據
- 使用Docker Hub
- Docker Hub
- 賬戶
- 存儲庫
- 自動構建
- 官方案例
- Docker中運行MongoDB
- Docker中運行Redis服務
- Docker中運行PostgreSQL
- Docker中運行Riak服務
- Docker中運行SSH進程服務
- Docker中運行CouchDB服務
- Docker中運行Apt-Cacher-ng服務