摘要:安装支持以下的版本或更高的版本版本要求目前,仅发行版本中的内核支持。
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 ~]#
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/27071.html
摘要:前言本文只是一个简单的使用来提供一些如数据库等公共服务的搭建过程记录的详细配置可以参考官方文档或这篇文章由于工作环境是在下对的支持很不好如果要在下安装请确保系统达到官方要求这里记录的是使用虚拟机的情况下搭建安装官方文档中详细说明了不同系统 前言 本文只是一个简单的使用docker来提供一些如数据库,redis等公共服务的搭建过程记录.docker-compose.yml的详细配置可以参...
摘要:型网络这是容器的默认网络类型,网桥模式意味着容器间可以互相通信,而对外的通信需要借助宿主机,这一形式通常表现为端口号的映射。 以下记录 Docker 中的常用操作、指令,使得大家能够快速地使用 Docker。 为什使用 Docker? 为什么要使用 Docker?就个人而言,Docker 能提供的最大便利在于这种技术面对程序环境迁移时所表现的卓越性。 这种性能使得我们不必在分享代码或项...
摘要:这相当于在原始安装程序中调整文件。警告我并没有告诉这件事,因为这可能会吓到他或任何其他专家。在创建应用商店条目的过程中,还有两个问题需要解决变量需要设置为确切值,这样用户就可以通过它连接到该实例。 Harbor Registry是VMware公司的Docker镜像管理产品。相较于其他镜像仓库,Harbor提供身份管理功能,安全性更高,支持单个主机上的多个registry,这些功能正是很...
摘要:对测试的影响让单元测试运行的更顺畅单元测试驱动开发是一个很好的应用程序开发方式,单元测试往往也是和代码一起被提交到代码仓库中。但是很多单元测试通常依赖于很多其他服务,而这些服务的标准化配置往往是一个难点,如数据库的搭建防火墙的配置等。 传统的软件开发、测试、运维需要三个团队在三个不同的环境中进行,而三个环境的不同引发了很多的问题。如:工作内容的重复;开发环境中可运行的程序在测试和运维环...
阅读 808·2023-04-26 00:11
阅读 2594·2021-11-04 16:13
阅读 2054·2021-09-09 09:33
阅读 1442·2021-08-20 09:35
阅读 3768·2021-08-09 13:42
阅读 3568·2019-08-30 15:55
阅读 953·2019-08-30 15:55
阅读 2165·2019-08-30 13:55