我使用Docker rest api构建图像,然后创建并运行容器。我可以成功构建图像,但是当我打电话来创建一个容器时,我找不到“未找到的”#404;' 404回复,没有其他信息。我该怎么调试呢?
请求:
Method: POST,
RequestUri: 'https://myhost:2376/v1.21/containers/create?name=mycontainer',
Version: 1.1,
Content: System.Net.Http.StringContent,
Headers:
{
Content-Type: application/json; charset=utf-8
Content-Length: 232
}}
JSON:
{
"Image":"myimage",
"ExposedPorts":{"80/tcp":null},
"Env":[
"ENV_1=xxx",
"ENV_2=xxxxx"
],
"HostConfig: {
"Links":null,
"Env":null,
"PortBindings":null,
"RestartPolicy":{"Name":"always"},
"Binds":["myvol:/var/lib/myvol"]
}
}