-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
-
The "/images/create" request is a POST request but nothing is actually being posted. Either change the query parameters into JSON post payload for or change the request type to a GET request.
-
The first chunk of the response contains a status JSON data that ends with "\r\n" but subsequent chunks don't end with a new line character therefore making difficult to parse the response. Bellow is the raw response I am seeing:
{"status":"Pulling repository base"}\r\n {"status":"Pulling image (ubuntu-quantl) from base","progressDetail":{},"id":"b750fe79269d"}{"status":"Pulling image (ubuntu-quantl) from base, endpoint: https://cdn-registry-1.docker.io/v1/","progressDetail":{},"id":"b750fe79269d"}{"status":"Pulling dependent layers","progressDetail":{},"id":"b750fe79269d"}{"status":"Download complete","progressDetail":{},"id":"27cf78414709"}{"status":"Download complete","progressDetail":{},"id":"b750fe79269d"}{"status":"Download complete","progressDetail":{},"id":"b750fe79269d"} -
The "/images/create" response property names don't conform to the general pascal casing used by Docker Remote API. Change response to conform to this casing:
{"Status":"Pulling blah", "Error": "blah", "ProgressDetail": "blah" } -
The "/images/create" is a blocking operation that could take some time. Instead of blocking you should utilize command/query pattern for the request. The create image request should return a token/id for the request and allow the user to query the status of the request. Break the API down to:
Request: "/images/create" Response: "{"Status": "Creating Image ....", "Id": "abc", "Error": [true|false]}"Request: "/images/create/status?Id=abc Response: "[ {"Status": "Creating Image ....", "Id": "abc", "Error": [true|false]} ]"