Docker Rest API Configuration and invocation

Source: Internet
Author: User
Tags port number

By default, Docker only allows the operation of Docker Daemon through UNIX socket communication, but sometimes we want to invoke its rest API via HTTP, and we need to configure the startup parameters separately


In order to make the configuration permanent, modify its profile/etc/default/docker in Ubuntu environment, add docker_opts= "-h=unix:///var/run/docker.sock-h=0.0.0.0:6732", Restart the Docker service with browser access to the settings host: Port number (6372)/Docker API Operation Docker, followed by an API-based how to make a simple management tool, first a prototype diagram

# docker upstart and sysvinit configuration file

# Customize location of the Docker binary (especially for development TES Ting).
#DOCKER = "/usr/local/bin/docker"

# Use Docker_opts to modify the daemon startup options.
#DOCKER_OPTS = "--dns 8.8.8.8--dns 8.8.4.4"
docker_opts= "-h=unix:///var/run/docker.sock-h=0.0.0.0:6732"
# If you need Docker-to-use an HTTP proxy, it can also is specified here.
#export http_proxy= "http://127.0.0.1:3128/"

# This was also a handy place to tweak where Docker ' s temporary files go.
  #export tmpdir= "/mnt/bigdrive/docker-tmp"


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.