You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec.md
+36-27Lines changed: 36 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,36 +197,12 @@ There are two ways to push blobs: chunked or monolithic.
197
197
##### Pushing a blob monolithically
198
198
199
199
There are two ways to push a blob monolithically:
200
-
1. A single `POST` request
201
-
2. A `POST` request followed by a `PUT` request
200
+
1. A `POST` request followed by a `PUT` request
201
+
2. A single `POST` request
202
202
203
203
---
204
204
205
-
To push a blob monolithically by using a single POST request, perform a `POST` request to a URL in the following form, and with the following headers and body:
Here, `<name>` is the repository's namespace, `<digest>` is the blob's digest, and `<length>` is the size (in bytes) of the blob.
217
-
218
-
The `Content-Length` header MUST match the blob's actual content length. Likewise, the `<digest>` MUST match the blob's digest.
219
-
220
-
Successful completion of the request MUST return either a `201 Created` or a `202 Accepted`, and MUST include the following header:
221
-
222
-
```
223
-
Location: <blob-location>
224
-
```
225
-
226
-
Here, `<blob-location>` is a pullable blob URL. This location does not necessarily have to be served by your register, for example, in the case of a signed URL from
227
-
some cloud storage provider that your registry generates.
228
-
229
-
---
205
+
###### POST then PUT
230
206
231
207
To push a blob monolithically by using a POST request followed by a PUT request, there are two steps:
232
208
1. Obtain a session id (upload URL)
@@ -270,6 +246,39 @@ Location: <blob-location>
270
246
271
247
With `<blob-location>` being a pullable blob URL.
272
248
249
+
---
250
+
251
+
###### Single POST
252
+
253
+
Registries MAY support pushing blobs using a single POST request.
254
+
255
+
To push a blob monolithically by using a single POST request, perform a `POST` request to a URL in the following form, and with the following headers and body:
Here, `<name>` is the repository's namespace, `<digest>` is the blob's digest, and `<length>` is the size (in bytes) of the blob.
267
+
268
+
The `Content-Length` header MUST match the blob's actual content length. Likewise, the `<digest>` MUST match the blob's digest.
269
+
270
+
Registries that do not support single request monolithic uploads SHOULD return a `202 Accepted` status code and `Location` header and clients SHOULD proceed with a subsequent PUT request, as described by the [POST then PUT upload method](#post-then-put).
271
+
272
+
Successful completion of the request MUST return a `201 Created` and MUST include the following header:
273
+
274
+
```
275
+
Location: <blob-location>
276
+
```
277
+
278
+
Here, `<blob-location>` is a pullable blob URL. This location does not necessarily have to be served by your register, for example, in the case of a signed URL from
279
+
some cloud storage provider that your registry generates.
280
+
281
+
273
282
##### Pushing a blob in chunks
274
283
275
284
A chunked blob upload is accomplished in three phases:
0 commit comments