摘要:安裝支持以下的版本或更高的版本版本要求目前,僅發行版本中的內核支持。
CentOS Docker 安裝
Docker支持以下的CentOS版本:
CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本
版本要求
目前,CentOS 僅發行版本中的內核支持 Docker。 Docker 運行在 CentOS 7 上,要求系統為64位、系統內核版本為 3.10 以上。 Docker 運行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系統為64位、系統內核版本為 2.6.32-431 或者更高版本。
查看操作系統版本
[root@Optimus ~]# cat /etc/issue CentOS release 6.6 (Final) Kernel on an m [root@Optimus ~]# cat /proc/version Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014安裝
教程參考:
Docker的安裝配置及使用詳解
Centos docker安裝
安裝docker
1. yum install -y epel-releas 2. yum install docker-io
[root@Optimus ~]# yum install docker-io Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile epel/metalink | 7.1 kB 00:00 * base: mirrors.btte.net * epel: ftp.riken.jp * extras: mirrors.btte.net * updates: mirrors.btte.net base | 3.7 kB 00:00 epel | 4.3 kB 00:00 epel/primary_db | 5.9 MB 00:40 extras | 3.4 kB 00:00 nginx | 2.9 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.7 MB 00:26 Resolving Dependencies --> Running transaction check ---> Package docker-io.x86_64 0:1.7.1-2.el6 will be installed --> Processing Dependency: lxc for package: docker-io-1.7.1-2.el6.x86_64 --> Processing Dependency: libcgroup for package: docker-io-1.7.1-2.el6.x86_64 --> Running transaction check ---> Package libcgroup.x86_64 0:0.40.rc1-24.el6_9 will be installed ---> Package lxc.x86_64 0:1.0.10-2.el6 will be installed --> Processing Dependency: lua-lxc(x86-64) = 1.0.10-2.el6 for package: lxc-1.0.10-2.el6.x86_64 --> Processing Dependency: lua-alt-getopt for package: lxc-1.0.10-2.el6.x86_64 --> Processing Dependency: liblxc.so.1()(64bit) for package: lxc-1.0.10-2.el6.x86_64 --> Running transaction check ---> Package lua-alt-getopt.noarch 0:0.7.0-1.el6 will be installed ---> Package lua-lxc.x86_64 0:1.0.10-2.el6 will be installed --> Processing Dependency: lua-filesystem for package: lua-lxc-1.0.10-2.el6.x86_64 ---> Package lxc-libs.x86_64 0:1.0.10-2.el6 will be installed --> Running transaction check ---> Package lua-filesystem.x86_64 0:1.4.2-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================================================================================= Installing: docker-io x86_64 1.7.1-2.el6 epel 4.6 M Installing for dependencies: libcgroup x86_64 0.40.rc1-24.el6_9 updates 131 k lua-alt-getopt noarch 0.7.0-1.el6 epel 6.9 k lua-filesystem x86_64 1.4.2-1.el6 epel 24 k lua-lxc x86_64 1.0.10-2.el6 epel 16 k lxc x86_64 1.0.10-2.el6 epel 124 k lxc-libs x86_64 1.0.10-2.el6 epel 258 k Transaction Summary ================================================================================================================================================================================================================================= Install 7 Package(s) Total download size: 5.1 M Installed size: 20 M Is this ok [y/N]: y Downloading Packages: (1/7): docker-io-1.7.1-2.el6.x86_64.rpm | 4.6 MB 00:25 (2/7): libcgroup-0.40.rc1-24.el6_9.x86_64.rpm | 131 kB 00:00 (3/7): lua-alt-getopt-0.7.0-1.el6.noarch.rpm | 6.9 kB 00:00 (4/7): lua-filesystem-1.4.2-1.el6.x86_64.rpm | 24 kB 00:00 (5/7): lua-lxc-1.0.10-2.el6.x86_64.rpm | 16 kB 00:00 (6/7): lxc-1.0.10-2.el6.x86_64.rpm | 124 kB 00:00 (7/7): lxc-libs-1.0.10-2.el6.x86_64.rpm | 258 kB 00:01 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 177 kB/s | 5.1 MB 00:29 warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 Importing GPG key 0x0608B895: Userid : EPEL (6)Package: epel-release-6-8.noarch (@extras) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : lxc-libs-1.0.10-2.el6.x86_64 1/7 Installing : lua-filesystem-1.4.2-1.el6.x86_64 2/7 Installing : lua-lxc-1.0.10-2.el6.x86_64 3/7 Installing : lua-alt-getopt-0.7.0-1.el6.noarch 4/7 Installing : lxc-1.0.10-2.el6.x86_64 5/7 Installing : libcgroup-0.40.rc1-24.el6_9.x86_64 6/7 Installing : docker-io-1.7.1-2.el6.x86_64 7/7 Verifying : lua-lxc-1.0.10-2.el6.x86_64 1/7 Verifying : lxc-libs-1.0.10-2.el6.x86_64 2/7 Verifying : libcgroup-0.40.rc1-24.el6_9.x86_64 3/7 Verifying : lxc-1.0.10-2.el6.x86_64 4/7 Verifying : docker-io-1.7.1-2.el6.x86_64 5/7 Verifying : lua-alt-getopt-0.7.0-1.el6.noarch 6/7 Verifying : lua-filesystem-1.4.2-1.el6.x86_64 7/7 Installed: docker-io.x86_64 0:1.7.1-2.el6 Dependency Installed: libcgroup.x86_64 0:0.40.rc1-24.el6_9 lua-alt-getopt.noarch 0:0.7.0-1.el6 lua-filesystem.x86_64 0:1.4.2-1.el6 lua-lxc.x86_64 0:1.0.10-2.el6 lxc.x86_64 0:1.0.10-2.el6 lxc-libs.x86_64 0:1.0.10-2.el6 Complete!
加入開機啟動
[root@Optimus ~]# chkconfig docker on
啟動docker
[root@Optimus ~]# service docker start Starting cgconfig service: [ OK ] Starting docker: [ OK ]
查看docker版本
[root@Optimus ~]# docker version Client version: 1.7.1 Client API version: 1.19 Go version (client): go1.4.2 Git commit (client): 786b29d/1.7.1 OS/Arch (client): linux/amd64 Server version: 1.7.1 Server API version: 1.19 Go version (server): go1.4.2 Git commit (server): 786b29d/1.7.1 OS/Arch (server): linux/amd64
查看docker信息
[root@Optimus ~]# docker info Containers: 0 Images: 0 Storage Driver: devicemapper Pool Name: docker-8:1-67240264-pool Pool Blocksize: 65.54 kB Backing Filesystem: extfs Data file: /dev/loop0 Metadata file: /dev/loop1 Data Space Used: 305.7 MB Data Space Total: 107.4 GB Data Space Available: 107.1 GB Metadata Space Used: 733.2 kB Metadata Space Total: 2.147 GB Metadata Space Available: 2.147 GB Udev Sync Supported: true Deferred Removal Enabled: false Data loop file: /var/lib/docker/devicemapper/devicemapper/data Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata Library Version: 1.02.89-RHEL6 (2014-09-01) Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 2.6.32-504.el6.x86_64 Operating System:CPUs: 24 Total Memory: 15.52 GiB Name: Optimus ID: OKJW:54WI:244F:NBPA:ULP6:LTA3:TJ5T:4VNH:EALS:YGYJ:POLS:WIV5
下載centos鏡像
[root@Optimus ~]# docker pull centos latest: Pulling from centos 6c5159923047: Pull complete acec82331181: Pull complete 1c1b67b33c28: Pull complete Digest: sha256:57c91a43765de2147fa666a128477bc6101d6fda660feaaa5fbb1a8b110c934f Status: Downloaded newer image for centos:latest
查看鏡像
[root@Optimus ~]# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos latest 1c1b67b33c28 5 weeks ago 196.6 MB
運行centos鏡像
[root@Optimus ~]# docker run -i -t centos /bin/bash [root@0d1f6225836b /]#
查找鏡像
[root@Optimus ~]# docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos latest 1c1b67b33c28 5 weeks ago 196.6 MB [root@Optimus ~]# docker images -a REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE centos latest 1c1b67b33c28 5 weeks ago 196.6 MB6c5159923047 5 weeks ago 196.6 MB acec82331181 5 weeks ago 196.6 MB
刪除鏡像:第一次刪除時顯示沖突,加-f強制刪除
[root@Optimus ~]# docker rmi 1c1b67b33c28 Error response from daemon: Conflict, cannot delete 1c1b67b33c28 because the container 0d1f6225836b is using it, use -f to force Error: failed to remove images: [1c1b67b33c28] [root@Optimus ~]# docker rmi -f 1c1b67b33c28 Untagged: centos:latest Deleted: 1c1b67b33c2810dcdbe70cf5ab186f1de50b138d06877e6b8421d5329a70beb1 Deleted: acec82331181312afa99df6a79e541ea819d64d32af6f4d3656897ce63d55f88 Deleted: 6c51599230478bde53cfcf5f4e7f68c2bf295102f31146c0bb6e9b814365c0e7 [root@Optimus ~]# docker images -a REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE [root@Optimus ~]#
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/27071.html
摘要:前言本文只是一個簡單的使用來提供一些如數據庫等公共服務的搭建過程記錄的詳細配置可以參考官方文檔或這篇文章由于工作環境是在下對的支持很不好如果要在下安裝請確保系統達到官方要求這里記錄的是使用虛擬機的情況下搭建安裝官方文檔中詳細說明了不同系統 前言 本文只是一個簡單的使用docker來提供一些如數據庫,redis等公共服務的搭建過程記錄.docker-compose.yml的詳細配置可以參...
摘要:型網絡這是容器的默認網絡類型,網橋模式意味著容器間可以互相通信,而對外的通信需要借助宿主機,這一形式通常表現為端口號的映射。 以下記錄 Docker 中的常用操作、指令,使得大家能夠快速地使用 Docker。 為什使用 Docker? 為什么要使用 Docker?就個人而言,Docker 能提供的最大便利在于這種技術面對程序環境遷移時所表現的卓越性。 這種性能使得我們不必在分享代碼或項...
摘要:這相當于在原始安裝程序中調整文件。警告我并沒有告訴這件事,因為這可能會嚇到他或任何其他專家。在創建應用商店條目的過程中,還有兩個問題需要解決變量需要設置為確切值,這樣用戶就可以通過它連接到該實例。 Harbor Registry是VMware公司的Docker鏡像管理產品。相較于其他鏡像倉庫,Harbor提供身份管理功能,安全性更高,支持單個主機上的多個registry,這些功能正是很...
摘要:對測試的影響讓單元測試運行的更順暢單元測試驅動開發是一個很好的應用程序開發方式,單元測試往往也是和代碼一起被提交到代碼倉庫中。但是很多單元測試通常依賴于很多其他服務,而這些服務的標準化配置往往是一個難點,如數據庫的搭建防火墻的配置等。 傳統的軟件開發、測試、運維需要三個團隊在三個不同的環境中進行,而三個環境的不同引發了很多的問題。如:工作內容的重復;開發環境中可運行的程序在測試和運維環...
閱讀 861·2023-04-26 00:11
閱讀 2658·2021-11-04 16:13
閱讀 2107·2021-09-09 09:33
閱讀 1477·2021-08-20 09:35
閱讀 3826·2021-08-09 13:42
閱讀 3611·2019-08-30 15:55
閱讀 1057·2019-08-30 15:55
閱讀 2222·2019-08-30 13:55