Centos7-64位系统安装Docker
来源:互联网 发布:删除手机预装软件 编辑:程序博客网 时间:2024/06/07 00:07
一、直接在线安装(有楼梯的话选择)
1、安装依赖包:yum install -y yum-utils device-mapper-persistent-data lvm2
2、安装稳定的仓库:
yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
3、安装Docker(社区版)
a)更新yum的索引:yum makecache fast
b)安装最新版的Docker:yum install docker-ce
c)查看版本(安装版本排序):yum list docker-ce.x86_64 --showduplicates | sort -r
d)安装指定版本的Docker:yum install docker-ce-<VERSION>
4、启动Docker:systemctl start docker
5、测试:docker run hello-world
6、要升级Docker CE,首先快速运行sudo yum makecache,然后按照安装说明,选择要安装的新版本。
二、手动下载安装包
1、到https://download.docker.com/linux/centos/7/x86_64/stable/Packages/并下载要安装的Docker版本的.rpm文件。
2、安装:yum install /path/to/package.rpm
3、启动:systemctl start docker
4、测试:docker run hello-world
三、卸载:
1、卸载Docker软件包: yum remove docker-ce
2、删除所有图像,容器和卷:rm -rf /var/lib/docker
四、可能会出现的异常:
[root@VM_162_135_centos ~]# docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-worldb04784fba78d: Pulling fs layer docker: error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/18/1815c82652c03bfd8644afda26fb184f2ed891d921b20a0703b46768f9755c57/data?Expires=1500279939&Signature=TTj25I73aNR5f1NMrIGFVQNX9KS99JpEn9Dd6V4XOK-Z5FLPX2gKv2kg6fubYPr-FIqnASwZ0fNzj600XQ5zv7uSEtbnXdKHu18FcjVM3eJ~df6bXWqcJml9QqiF07ZHm0udzIOpr2tVD64YFFeNvw~1pJKBpAHTA2th~V1gpa8_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout.See 'docker run --help'.
解决方案:
#vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE='eth0'NM_CONTROLLED='yes'ONBOOT='yes'IPADDR='10.104.162.135'NETMASK='255.255.192.0'GATEWAY='10.104.128.1'#新增以下代码DNS1=8.8.8.8 #Google的DNSDNS2=114.114.114.114 #电信的DNS# service network restart
再次启动即可:
[root@VM_162_135_centos ~]# docker run hello-worldWARNING: IPv4 forwarding is disabled. Networking will not work.Hello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
对于:WARNING: IPv4 forwarding is disabled. Networking will not work.的解决办法:
# vi /etc/sysctl.conf或者# vi /usr/lib/sysctl.d/00-system.conf添加如下代码: net.ipv4.ip_forward=1重启network服务# systemctl restart network查看是否修改成功# sysctl net.ipv4.ip_forward如果返回为“net.ipv4.ip_forward = 1”则表示成功
这时启动docker时将不会显示WARNING: IPv4 forwarding is disabled. Networking will not work.
[root@VM_162_135_centos ~]# docker run hello-worldHello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
到此Docker安装完成!
- Centos7-64位系统安装Docker
- Centos7系统Docker安装-配置-调试-应用
- CentOS7 64位系统安装配置hadoop2.7.2
- centos7.2 linux 64位系统上安装mysql
- centos7 64位系统安装32位库时发生冲突
- CentOS7 64位 安装 CodeBlocks
- CentOS7 64位 安装 CodeBlocks
- CentOS7 64位 安装 CodeBlocks
- Centos7安装Docker
- CentOS7 安装 使用 Docker
- centos7安装docker
- docker centos7 安装ssh
- centos7安装docker
- Centos7 dvd 安装docker
- Centos7中安装docker
- centos7安装docker最新版
- centos7安装docker
- centos7.1 安装 docker
- codeforce681c Heap Operations
- 打印金字塔
- 欢迎使用CSDN-markdown编辑器
- 八岁男童坠楼身亡!暑假意外高发期,这些情况不得不防······
- leetcode 633. Sum of Square Numbers
- Centos7-64位系统安装Docker
- mysql常用命令
- 数据结构-链表(list)
- 海康摄像头视频实时监控
- 20170718工作记账流水
- rails yield与content_for
- Struts2.5+Spring4.3+Hibernate5搭建
- Google protocol buffer文件的原理和使用
- weex 集成到iOS