Centos Docker1.12 远程Rest api访问
2017-01-05 15:15
447 查看
docker默认是没有开启HTTP远程访问的,默认只支持通过unix socket通信操作docker daemon,需要使用HTTP restful接口需要修改配置。
1、修改配置文件,文件位置/lib/systemd/system/docker.service。将原来的ExecStart修改为:
2.执行
注:如果docker命令是无法使用的请在、etc/profile中配置:
是之生效
3、官方API说明文档
官方链接:Docker Remote API v1.24
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
相关文章推荐
- centos6.5上安装docker
- 在kubernetes上实现tomcat日志的持久化
- docker容器的网络信息查看
- Docker Compose 介绍入门使用
- openstack kilo-with-dokcer
- DockerFile创建一个nginx容器的全过程
- Go语言gdb调试踩坑
- docker初识之五分钟认识docker
- Docker 学习文档(知识结构整理)
- Docker与Golang的巧妙结合
- Docker使用过程中的一些注意事项
- docker中安装quagga详细介绍
- 生产环境中安全运行Docker容器
- Docker 教程之获取镜像基础知识详解
- Docker学习之常用的基础命令总结
- Docker 教程之CentOS安装 Docker
- 深入了解docker(docker镜像、容器、仓库的基本概念)
- 使用Docker容器搭建MySql主从复制