我正在尝试使用 API/1.5 在 docker 容器中运行守护进程,这是我的 POST 请求,容器创建成功,而命令似乎运行失败,这里有什么问题?请给我一些进展,谢谢.
{
"Hostname":"",
"User":"",
"Memory":10000000,
"MemorySwap":0,
"AttachStdin":true,
"AttachStdout":true,
"AttachStderr":true,
"PortSpecs": ["8080:8080"],
"Privileged": true,
"Tty":true,
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
"Cmd":[
"nc", "-l", "8080"
],
"Dns":null,
"Image":"base",
"Volumes":{},
"VolumesFrom":"",
"WorkingDir":"~"
}
这是回应:
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 113
Date: Sun, 29 Sep 2013 13:27:52 GMT
{"Id":"9a880dcbbbda","Warnings":["Your kernel does not support memory swap capabilities. Limitation discarded."]}
我测试了容器是否正在运行sudo docker ps -l
并显示:
ID IMAGE COMMAND CREATED STATUS PORTS
9a880dcbbbda base:latest nc -l 8080 33 seconds ago Exit 0