From 61de9629799094d579068899ca407d5034183e0f Mon Sep 17 00:00:00 2001 From: Josh Hawn Date: Tue, 1 Sep 2015 10:05:30 -0700 Subject: [PATCH] [docs] Add description of "X-Registry-Config" The structure of this header has never been specified in the docs and has been a pain point for those who have tried to get registry authentication to work during builds. This Patch *finally* adds a description of JSON object which should be base64-url-safe-encoded and used as the value of the X-Registry-Config HTTP request header during `POST /build`. Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn) --- docs/reference/api/docker_remote_api_v1.20.md | 23 ++++++++++++++++++- docs/reference/api/docker_remote_api_v1.21.md | 23 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/reference/api/docker_remote_api_v1.20.md b/docs/reference/api/docker_remote_api_v1.20.md index 571c587b93..a68ed09229 100644 --- a/docs/reference/api/docker_remote_api_v1.20.md +++ b/docs/reference/api/docker_remote_api_v1.20.md @@ -1341,7 +1341,28 @@ Query Parameters: Request Headers: - **Content-type** – Set to `"application/tar"`. -- **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. Status Codes: diff --git a/docs/reference/api/docker_remote_api_v1.21.md b/docs/reference/api/docker_remote_api_v1.21.md index e466552af9..33ccadb3eb 100644 --- a/docs/reference/api/docker_remote_api_v1.21.md +++ b/docs/reference/api/docker_remote_api_v1.21.md @@ -1351,7 +1351,28 @@ Query Parameters: Request Headers: - **Content-type** – Set to `"application/tar"`. -- **X-Registry-Config** – base64-encoded ConfigFile object +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. Status Codes: