Docker Remote API 配置

默认状况下,Docker只容许经过unix socket通讯操做Docker daemon,但有时咱们想经过HTTP调用其Rest API,需单独配置启动参数html

 

为了使配置永久生效,在Ubuntu环境下修改其配置文件/etc/default/docker,(centos : /etc/sysconfig/docker) 加入DOCKER_OPTS="-H=unix:///var/run/docker.sock -H=0.0.0.0:6732",重启Docker服务,可经过浏览器访问设置主机:端口号(6372)/ Docker API操做Dockerdocker

 

  1. # Docker Upstart and SysVinit configuration file  
  2.   
  3. # Customize location of Docker binary (especially for development testing).  
  4. #DOCKER="/usr/local/bin/docker"  
  5.   
  6. # Use DOCKER_OPTS to modify the daemon startup options.  
  7. #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"  
  8. DOCKER_OPTS="-H=unix:///var/run/docker.sock -H=0.0.0.0:6732"  
  9. # If you need Docker to use an HTTP proxy, it can also be specified here.  
  10. #export http_proxy="http://127.0.0.1:3128/"  
  11.   
  12. # This is also a handy place to tweak where Docker's temporary files go.  
  13. #export TMPDIR="/mnt/bigdrive/docker-tmp"  
相关文章
相关标签/搜索