I am trying to create a Docker container with the Docker Remote API using a Python script to do the Post opertion. This is my Python Script:-
import requests
import json
url = "http://localhost:4243/containers/create"
payload = {'Hostname':'','User':'','Memory':'0','MemorySwap':'0','AttachStdin':'false','AttachStdout':'t rue','AttachStderr':'true','PortSpecs':'null','Privileged': 'false','Tty':'false','OpenStdin':'false','StdinOnce':'false','Env':'null','Cmd':['date'],'Dns':'null','Image':'ubuntu','Volumes':{},'VolumesFrom':'','WorkingDir':''}
headers = {'content-type': 'application/json', 'Accept': 'text/plain'}
print requests.post(url, data = json.dumps(payload), headers=headers).text
But when I run the script it shows this error
json: cannot unmarshal string into Go value of type bool
What is wrong with my script? I use Requests HTTP library for Python v2.7.5 and Ubuntu 13.10. I am new to docker and python scripting. Any help would be Appreciated.
TrueandFalseinstead of the strings"true"and"false"in your payload dict.