在centOS7上安装docker
来源:互联网 发布:linux安装python 编辑:程序博客网 时间:2024/06/05 17:42
更新之前需要配置环境变量http_proxy
Vim /etc/profile ,添加
export http_proxy=http://proxy-prc.intel.com:911
export https_proxy=https://proxy-prc.intel.com:911
source /etc/profile
[root@localhost ~]# yum update
[root@localhost ~]# systemctl enable docker.service
[root@localhost ~]#systemctl start docker
[root@localhost ~]# docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
docker: Network timed out while trying to connect tohttps://index.docker.io/v1/repositories/library/hello-world/images. You maywant to check your internet connection or if you are behind a proxy..
See 'docker run --help'.
查看失败原因
[root@localhost ~]# env|grep http
http_proxy=http://proxy-prc.intel.com:911
https_proxy=https://proxy-prc.intel.com:911
[root@localhost ~]# curl -v https://index.docker.io/v1/repositories/library/hello-world/images
* About to connect() to proxy proxy-prc.intel.com port 911(#0)
* Trying10.240.252.20...
* Connected to proxy-prc.intel.com (10.240.252.20) port 911(#0) //说明不是代理问题
* Establish HTTP proxy tunnel to index.docker.io:443
> CONNECT index.docker.io:443 HTTP/1.1
> Host: index.docker.io:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
http没有问题,但是系统文件代理没有设置
[root@localhost ~]#mkdir /etc/systemd/system/docker.service.d
[root@localhost ~]#vim /etc/systemd/system/docker.service.d/http-proxy.conf
[root@localhost ~]# cat/etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="http_proxy=http://proxy-prc.intel.com:911"
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# systemctl show docker --propertyEnvironment
Environment=http_proxy=http://proxy-prc.intel.com:911
[root@localhost ~]# docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest:sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to beworking correctly.
成功运行!
- 在centOS7上安装docker
- 在CentOS7上安装docker
- 在CentOS7上安装docker compose
- 在centos7中安装docker
- 在centos7下安装docker
- CentOS7上安装和使用Docker
- CentOS7.2 上安装 Docker 教程
- centos7上docker安装和使用教程
- CentOS7上安装和使用Docker
- Centos7 的Docker上如何安装MySQL
- centos7上docker安装和使用教程
- 在CentOS7上安装NVIDIA CUDA 并在docker中使用CUDA
- 一、Docker在CentOS7下安装
- (二)在centos7 下安装docker
- 如何在CentOS7环境下安装Docker
- 在centos7上安装DSPC
- 在CentOS7上安装MySQL
- 在CentOS7上安装mysql
- CentOS 7 LVM创建与使用
- 游戏是什么?
- 背景可自动填充屏幕宽度flowlayout
- 成绩排序【编程题】
- oracle中的decode的使用
- 在centOS7上安装docker
- 2016.12.30回顾
- 如何将flask 发布到 SAE
- 70 leetcode - Single Number I,II,III
- sql left join 联合查询示例
- 202. Happy Number
- Object静态方法
- Android之简单的开机动画
- Java Web架构知识整理——记一次阿里面试经历