Browse code

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>
(cherry picked from commit f919a26a9fb96ef07133183b4f693ff9508ae823)

Yong Tang authored on 2016/04/10 03:30:48
Showing 9 changed files
... ...
@@ -151,7 +151,7 @@ Create a container
151 151
              "ExposedPorts": {
152 152
                      "22/tcp": {}
153 153
              },
154
-             "SecurityOpts": [""],
154
+             "SecurityOpts": [],
155 155
              "HostConfig": {
156 156
                "Binds": ["/tmp:/tmp"],
157 157
                "Links": ["redis3:redis"],
... ...
@@ -151,7 +151,7 @@ Create a container
151 151
              "ExposedPorts": {
152 152
                      "22/tcp": {}
153 153
              },
154
-             "SecurityOpts": [""],
154
+             "SecurityOpts": [],
155 155
              "HostConfig": {
156 156
                "Binds": ["/tmp:/tmp"],
157 157
                "Links": ["redis3:redis"],
... ...
@@ -168,7 +168,7 @@ Create a container
168 168
                "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
169 169
                "NetworkMode": "bridge",
170 170
                "Devices": [],
171
-               "SecurityOpt": [""]
171
+               "SecurityOpt": []
172 172
             }
173 173
         }
174 174
 
... ...
@@ -184,7 +184,7 @@ Create a container
184 184
                "Devices": [],
185 185
                "Ulimits": [{}],
186 186
                "LogConfig": { "Type": "json-file", Config: {} },
187
-               "SecurityOpt": [""],
187
+               "SecurityOpt": [],
188 188
                "CgroupParent": ""
189 189
             }
190 190
         }
... ...
@@ -191,7 +191,7 @@ Create a container
191 191
              "Devices": [],
192 192
              "Ulimits": [{}],
193 193
              "LogConfig": { "Type": "json-file", "Config": {} },
194
-             "SecurityOpt": [""],
194
+             "SecurityOpt": [],
195 195
              "CgroupParent": ""
196 196
           }
197 197
       }
... ...
@@ -156,7 +156,7 @@ Create a container
156 156
            },
157 157
            "Volumes": {
158 158
              "/volumes/data": {}
159
-           }
159
+           },
160 160
            "WorkingDir": "",
161 161
            "NetworkDisabled": false,
162 162
            "MacAddress": "12:34:56:78:9a:bc",
... ...
@@ -193,7 +193,7 @@ Create a container
193 193
              "Devices": [],
194 194
              "Ulimits": [{}],
195 195
              "LogConfig": { "Type": "json-file", "Config": {} },
196
-             "SecurityOpt": [""],
196
+             "SecurityOpt": [],
197 197
              "CgroupParent": ""
198 198
           }
199 199
       }
... ...
@@ -160,7 +160,7 @@ Create a container
160 160
            },
161 161
            "Volumes": {
162 162
              "/volumes/data": {}
163
-           }
163
+           },
164 164
            "WorkingDir": "",
165 165
            "NetworkDisabled": false,
166 166
            "MacAddress": "12:34:56:78:9a:bc",
... ...
@@ -201,7 +201,7 @@ Create a container
201 201
              "Devices": [],
202 202
              "Ulimits": [{}],
203 203
              "LogConfig": { "Type": "json-file", "Config": {} },
204
-             "SecurityOpt": [""],
204
+             "SecurityOpt": [],
205 205
              "CgroupParent": "",
206 206
              "VolumeDriver": ""
207 207
           }
... ...
@@ -248,7 +248,7 @@ Create a container
248 248
            },
249 249
            "Volumes": {
250 250
              "/volumes/data": {}
251
-           }
251
+           },
252 252
            "WorkingDir": "",
253 253
            "NetworkDisabled": false,
254 254
            "MacAddress": "12:34:56:78:9a:bc",
... ...
@@ -294,7 +294,7 @@ Create a container
294 294
              "Devices": [],
295 295
              "Ulimits": [{}],
296 296
              "LogConfig": { "Type": "json-file", "Config": {} },
297
-             "SecurityOpt": [""],
297
+             "SecurityOpt": [],
298 298
              "CgroupParent": "",
299 299
              "VolumeDriver": "",
300 300
              "ShmSize": 67108864
... ...
@@ -267,7 +267,7 @@ Create a container
267 267
            },
268 268
            "Volumes": {
269 269
              "/volumes/data": {}
270
-           }
270
+           },
271 271
            "WorkingDir": "",
272 272
            "NetworkDisabled": false,
273 273
            "MacAddress": "12:34:56:78:9a:bc",
... ...
@@ -313,7 +313,7 @@ Create a container
313 313
              "Devices": [],
314 314
              "Ulimits": [{}],
315 315
              "LogConfig": { "Type": "json-file", "Config": {} },
316
-             "SecurityOpt": [""],
316
+             "SecurityOpt": [],
317 317
              "CgroupParent": "",
318 318
              "VolumeDriver": "",
319 319
              "ShmSize": 67108864