Bläddra i källkod

Fix incorrect request json body for `/containers/create` in remote API docs.

This fix tries to fix the incorrect request json body for
`/containers/create` in remote API docs.

When using the example json request for `/containers/create`, there are two
errors:
(1). `invalid character '"' after object key:value pair`
     This is because a `,` is missing after `"Volumes": {}`
     This issue exists in v1.20-v1.24
(2). `Invalid --security-opt: ""`
     This is becasue in `"SecurityOpt": [""]` line, an empty string
     `""` is passed yet `""` is not a valid `SecurityOpt`. Either no string,
     or a valid string (e.g., "no-new-privileges") could be used.
     This issue exists in v1.15-v1.24

This fix updates the docs and correct the above two issues.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Yong Tang 9 år sedan
förälder
incheckning
f919a26a9f

+ 1 - 1
docs/reference/api/docker_remote_api_v1.15.md

@@ -151,7 +151,7 @@ Create a container
              "ExposedPorts": {
              "ExposedPorts": {
                      "22/tcp": {}
                      "22/tcp": {}
              },
              },
-             "SecurityOpts": [""],
+             "SecurityOpts": [],
              "HostConfig": {
              "HostConfig": {
                "Binds": ["/tmp:/tmp"],
                "Binds": ["/tmp:/tmp"],
                "Links": ["redis3:redis"],
                "Links": ["redis3:redis"],

+ 1 - 1
docs/reference/api/docker_remote_api_v1.16.md

@@ -151,7 +151,7 @@ Create a container
              "ExposedPorts": {
              "ExposedPorts": {
                      "22/tcp": {}
                      "22/tcp": {}
              },
              },
-             "SecurityOpts": [""],
+             "SecurityOpts": [],
              "HostConfig": {
              "HostConfig": {
                "Binds": ["/tmp:/tmp"],
                "Binds": ["/tmp:/tmp"],
                "Links": ["redis3:redis"],
                "Links": ["redis3:redis"],

+ 1 - 1
docs/reference/api/docker_remote_api_v1.17.md

@@ -168,7 +168,7 @@ Create a container
                "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
                "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
                "NetworkMode": "bridge",
                "NetworkMode": "bridge",
                "Devices": [],
                "Devices": [],
-               "SecurityOpt": [""]
+               "SecurityOpt": []
             }
             }
         }
         }
 
 

+ 1 - 1
docs/reference/api/docker_remote_api_v1.18.md

@@ -184,7 +184,7 @@ Create a container
                "Devices": [],
                "Devices": [],
                "Ulimits": [{}],
                "Ulimits": [{}],
                "LogConfig": { "Type": "json-file", Config: {} },
                "LogConfig": { "Type": "json-file", Config: {} },
-               "SecurityOpt": [""],
+               "SecurityOpt": [],
                "CgroupParent": ""
                "CgroupParent": ""
             }
             }
         }
         }

+ 1 - 1
docs/reference/api/docker_remote_api_v1.19.md

@@ -191,7 +191,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "CgroupParent": ""
              "CgroupParent": ""
           }
           }
       }
       }

+ 2 - 2
docs/reference/api/docker_remote_api_v1.20.md

@@ -156,7 +156,7 @@ Create a container
            },
            },
            "Volumes": {
            "Volumes": {
              "/volumes/data": {}
              "/volumes/data": {}
-           }
+           },
            "WorkingDir": "",
            "WorkingDir": "",
            "NetworkDisabled": false,
            "NetworkDisabled": false,
            "MacAddress": "12:34:56:78:9a:bc",
            "MacAddress": "12:34:56:78:9a:bc",
@@ -193,7 +193,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "CgroupParent": ""
              "CgroupParent": ""
           }
           }
       }
       }

+ 2 - 2
docs/reference/api/docker_remote_api_v1.21.md

@@ -160,7 +160,7 @@ Create a container
            },
            },
            "Volumes": {
            "Volumes": {
              "/volumes/data": {}
              "/volumes/data": {}
-           }
+           },
            "WorkingDir": "",
            "WorkingDir": "",
            "NetworkDisabled": false,
            "NetworkDisabled": false,
            "MacAddress": "12:34:56:78:9a:bc",
            "MacAddress": "12:34:56:78:9a:bc",
@@ -201,7 +201,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "CgroupParent": "",
              "CgroupParent": "",
              "VolumeDriver": ""
              "VolumeDriver": ""
           }
           }

+ 2 - 2
docs/reference/api/docker_remote_api_v1.22.md

@@ -248,7 +248,7 @@ Create a container
            },
            },
            "Volumes": {
            "Volumes": {
              "/volumes/data": {}
              "/volumes/data": {}
-           }
+           },
            "WorkingDir": "",
            "WorkingDir": "",
            "NetworkDisabled": false,
            "NetworkDisabled": false,
            "MacAddress": "12:34:56:78:9a:bc",
            "MacAddress": "12:34:56:78:9a:bc",
@@ -294,7 +294,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "CgroupParent": "",
              "CgroupParent": "",
              "VolumeDriver": "",
              "VolumeDriver": "",
              "ShmSize": 67108864
              "ShmSize": 67108864

+ 2 - 2
docs/reference/api/docker_remote_api_v1.23.md

@@ -267,7 +267,7 @@ Create a container
            },
            },
            "Volumes": {
            "Volumes": {
              "/volumes/data": {}
              "/volumes/data": {}
-           }
+           },
            "WorkingDir": "",
            "WorkingDir": "",
            "NetworkDisabled": false,
            "NetworkDisabled": false,
            "MacAddress": "12:34:56:78:9a:bc",
            "MacAddress": "12:34:56:78:9a:bc",
@@ -313,7 +313,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "CgroupParent": "",
              "CgroupParent": "",
              "VolumeDriver": "",
              "VolumeDriver": "",
              "ShmSize": 67108864
              "ShmSize": 67108864

+ 2 - 2
docs/reference/api/docker_remote_api_v1.24.md

@@ -267,7 +267,7 @@ Create a container
            },
            },
            "Volumes": {
            "Volumes": {
              "/volumes/data": {}
              "/volumes/data": {}
-           }
+           },
            "WorkingDir": "",
            "WorkingDir": "",
            "NetworkDisabled": false,
            "NetworkDisabled": false,
            "MacAddress": "12:34:56:78:9a:bc",
            "MacAddress": "12:34:56:78:9a:bc",
@@ -313,7 +313,7 @@ Create a container
              "Devices": [],
              "Devices": [],
              "Ulimits": [{}],
              "Ulimits": [{}],
              "LogConfig": { "Type": "json-file", "Config": {} },
              "LogConfig": { "Type": "json-file", "Config": {} },
-             "SecurityOpt": [""],
+             "SecurityOpt": [],
              "StorageOpt": {},
              "StorageOpt": {},
              "CgroupParent": "",
              "CgroupParent": "",
              "VolumeDriver": "",
              "VolumeDriver": "",