github.com/uber/kraken@v0.1.4/docs/ENDPOINTS.md (about)

     1  **Table of Contents**
     2  
     3  - [Push And Pull Docker Images](#push-and-pull-docker-images)
     4    - [Pushing Docker Images To Kraken Proxy](#pushing-docker-images-to-kraken-proxy)
     5    - [Pulling Docker Images From Kraken Agent](#pulling-docker-images-from-kraken-agent)
     6  - [Upload and Download Generic Content Addressable Blobs](#upload-and-download-generic-content-addressable-blobs)
     7    - [Uploading Blobs To Kraken Origin](#uploading-blobs-to-kraken-origin)
     8    - [Downloading Blobs From Kraken Agent](#downloading-blobs-from-kraken-agent)
     9  
    10  # Push And Pull Docker Images
    11  
    12  Kraken proxy implements all [docker registry V2 endpoints](https://docs.docker.com/registry/spec/api/).
    13  Kraken agent only implements the GET and HEAD endpoints of docker registry.
    14  
    15  ## Pushing Docker Images To Kraken Proxy
    16  
    17  You can push images to proxy using normal docker push command:
    18  ```
    19  docker push {proxy_host}:{proxy_port}/{repo}:{tag}
    20  ```
    21  Proxy will then upload the blobs and tag to origin and build-index.
    22  
    23  Yon can also pull from proxy directly without going through the p2p network:
    24  ```
    25  docker pull {proxy_host}:{proxy_port}/{repo}:{tag}
    26  ```
    27  Note: if you didn't configure Kraken with TLS, you might need to update your docker daemon config to whitelist kraken-proxy as an [insecure registry](https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry) first.
    28  
    29  ## Pulling Docker Images From Kraken Agent
    30  
    31  To pull docker images from local kraken agent, run:
    32  ```
    33  docker pull localhost:{agent_registry_port}/{repo}:{tag}
    34  ```
    35  Note: kraken agent use different ports for docker registry endpoints and generic content addressable blobs. Please make sure you are using the port configured via `agent_registry_port`.
    36  
    37  # Upload and Download Generic Content Addressable Blobs
    38  
    39  Kraken's usecase is not limited to docker images.
    40  It exposes a separate set of endpoints for uploading and downloading generic [content addressable](https://en.wikipedia.org/wiki/Content-addressable_storage) blobs that's identified by SHA256 hash of the content.
    41  Kraken proxy and build-index are not used in this usecase.
    42  Uploads will be handled by Kraken origin, and downloads still go through Kraken agent.
    43  
    44  ## Uploading Blobs To Kraken Origin
    45  
    46  Blobs can be uploaded through the Kraken origin cluster and into your storage backend. All blobs
    47  must be uploaded in chunks, using the following API:
    48  
    49  ```
    50  POST /namespace/<namespace>/blobs/<digest>/uploads
    51  ```
    52  
    53  Starts the upload. Returns an upload id in the "Location" response header, which is used for
    54  uploading chunks of the blob.
    55  
    56  ```
    57  PATCH /namespace/<namespace>/blobs/<digest>/uploads/<uid>
    58  ```
    59  
    60  Uploads a chunk of the blob, using the previously returned upload id. Supply the chunk bytes in the
    61  request body. The "Content-Range" header in the request must specify the range of the chunk
    62  being uploaded, for example:
    63  
    64  ```
    65  Content-Range: 128,256
    66  ```
    67  
    68  This would upload the request body to bytes ``[128, 256)`` of the blob.
    69  
    70  ```
    71  PUT /namespace/<namespace>/blobs/<digest>/uploads/<uid>?through=<through>
    72  ```
    73  
    74  Commits the upload. If ``through`` is set to ``true``, the blob will be uploaded through the origin
    75  cluster and into the storage backend configured for ``namespace``.
    76  
    77  ## Downloading Blobs From Kraken Agent
    78  
    79  ```
    80  GET /namespace/<namespace>/blobs/<digest>
    81  ```
    82  
    83  Once Kraken has been configured with your storage information and namespace, you can download your
    84  blobs from any host with a Kraken agent running on it. The download endpoint takes your namespace
    85  and the content digest of the blob you want to download, and blocks until agent has downloaded the
    86  blob to its on-disk cache. Once the blob is downloaded locally, status 200 is returned and the
    87  blob content is streamed over the response body.
    88  
    89  Error codes:
    90  
    91  - 404: Blob was not found in your storage backend.
    92  - 5xx: Something went wrong. Check the response body for an error message, or reach out to the
    93    Kraken team.