下载与配置docker

安装docker

1.下载软件

在CentOS中下载docker,直接运行

yum install -y docke-io

因为使用代理,所以在虚拟机上面使用代理上网,无法连接网络
首先需要配置 /etc/profile

Http_proxy="http://your_proxy_ip:porxy_port"
Https_proxy="http://your_proxy_ip:porxy:port"

设置其生效:

Source /etc/profile

再次运行yum命令,安装成功

2.pull镜像

使用search:

docker search java

出现错误如下:

Pulling repository docker.io/library/busybox
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/busybox/images. You may want to check your internet connection or if you are behind a proxy.

需要设置docker提取的代理:
1.-mkdir
/etc/systemd/system/docker.service.d

2.创建http_proxy.conf文件

[Service]
Environment="HTTP_PROXY=http://10.131.3.10:8080"

3.设置daemon

sudo systemctl daemon-reload

4.重新启动docker

sudo systemctl restart docker

猜你喜欢

转载自blog.csdn.net/tang_jin2015/article/details/78861306