Docker provides the rest API for creating containers
Http://192.168.150.6:8888/containers/create?name=demo-mysql
Docker MySQL container parameters, send a POST request to Docker via Restclient
{"Hostname": "", "Domainname": "", "User": "", "Attachstdin": false, "attachstdout": True, "Attachstderr": True, "Tty": False, "Openstdin": false, "stdinonce": false, "ENV": ["mysql_root_password=123456"], "CMD": null, "entrypoint": null, " Image ":" Mysql:latest "," Labels ": {" Com.l2cloudo.mysql ":" Jake-mysql "}," Workingdir ": null," networkdisabled ": false," MacAddress ":" 12:34:56:78:9A:BC "," Exposedports ": {" 3306/tcp ": {}}," Hostconfig ": {" Binds ": ["/tmp:/tmp "]," Memory ": 0, "Memoryswap": 0, "cpushares": "Cpuperiod": 100000, "Cpusetcpus": "", "Cpusetmems": "", "Blkioweight": 300, " Oomkilldisable ": false," portbindings ": {" 3306/tcp ": [{" Hostport ":" 13306 "}]}," Publishallports ": false," privileged ": False, "Readonlyrootfs": false, "Dnssearch": [""], "extrahosts": null, "Capadd": ["Net_admin"], "Capdrop": ["MKNOD"], " Restartpolicy ": {" Name ":" "," Maximumretrycount ": 0}," Networkmode ":" Bridge "," Devices ": []," LogConfig ": {" Type ":" JSON -file "," Config ": {}}," Cgroupparent ":" "}}
When you create OK, the response is returned as follows:
{"Id": "Ceb3cd1143432822de2e28f194b8b4ac8d7a72eb4e50b692b9070dbfbd3df2fa", "Warnings": null}
Docker restapi Create MySQL Container