Getting started with Docker Rest API
System: Centos7.2, Docker version information is as follows:
[Python]View PlainCopy
- client:
- version: 17.03 0 -CE  
- api version: 1.26   
- go version: go1.7.5   
- Git commit: 3a232c8
- Built:tue Feb - ,:Ten: - .
- Os/arch:linux/amd64
- SERVER:  
- version: 17.03 0 -CE  
- api version: 1.26 (minimum version
- go version: go1.7.5   
- Git commit: 3a232c8
- Built:tue Feb - ,:Ten: - .
- Os/arch:linux/amd64
- Experimental:false
To open the Docker Rest API:
[Python]View PlainCopy
- Vi/usr/lib/systemd/system/docker.service
Modify or add a line of configuration:
[Python]View PlainCopy
- execstart=/usr/bin/dockerd-h tcp://0.0. 0.0 : 6066 - h unix:///var/run/docker.sock
specifies that the TCP protocol IP is any address, the port is 6066,
Restart Docker after saving:
[Python]View PlainCopy
- Systemctl Daemon-reload
[Python]View PlainCopy
- Systemctl Restart Docker
Enter the Curl 127.0.0.1:6066/info test.
Getting started with Docker Rest API