Docker默认是没有开启HTTP远程访问的,默认只支持通过unix socket通信操作docker daemon,需要使用HTTP restful接口需要修改配置。

1、修改配置文件,文件位置/lib/systemd/system/docker.service。将原来的ExecStart修改为:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
#ExecStart=/usr/bin/dockerd
#ExecStart=/usr/bin/dockerd -H 192.168.25.130:2375
ExecStart=/usr/bin/docker daemon --tls=false -H unix:///var/run/docker.sock -H tcp://192.168.25.130:2375
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
[Install]
WantedBy=multi-user.target

2.执行

systemctl daemon-reload
systemctl restart docker.service

注:如果docker命令是无法使用的请在、etc/profile中配置:

export DOCKER_HOST= 'http://192.168.25.128:2375'

是之生效

source /etc/profile

3、官方API说明文档

官方链接:Docker Remote API v1.24

最新文章

  1. SVN需要忽略的文件类型
  2. SSH搭建
  3. 编程实践中C语言的一些常见细节
  4. Dynamics AX 4.0 多表looup
  5. css实现div块半透明
  6. Python:if-while-for
  7. Thread Join()的用法
  8. MCS-51单片机I/O端口的存取
  9. Python用Tkinter的Frame实现眼睛护士的倒计时黑色屏幕
  10. 创建 userSettings/Microsoft.SqlServer.Configuration.LandingPage.Properties.Settings 的配置节处理程序时出错: 未能加载文件或程序集“System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。系统没找到指定的文件
  11. springboot + @scheduled 多任务并发
  12. MongoDB分片 在部署和维护管理 中常见事项的总结
  13. python set所用后列表不改变里面内容排序
  14. vue组件封装选项卡
  15. 【转】C++对成员访问运算符->的重载
  16. mysql无法远程连接到数据库解决方法
  17. rsync配置及优化
  18. nginx之配置proxy_set_header
  19. DB2默认的事务及并发锁机制
  20. linux和mac使用virtualenv使用和安装

热门文章

  1. 001杰信-创建MyEclipse与maven项目
  2. centos7安装avahi
  3. Linux环境下Apache配置多个虚拟主机挂载多站点同时运行
  4. 如何在 Linux 上录制你的终端操作
  5. 动态规划——最长公共子序列&&最长公共子串
  6. Javascript中的window.event.keyCode使用介绍
  7. Android 将时间戳转为代表"距现在多久之前"的字符串
  8. java利用反射机制判断对象的属性是否为空以及获取和设置该属性的值
  9. kafka "HelloWorld"实践
  10. ZOJ 3932 Handshakes