Skip to content

Commit 4b79cac

Browse files
committed
Add documentation for HTTP_AUTH_TOKEN_/HTTP_AUTH_HEADER_.
This has been supported since Buildkit v0.23.0.
1 parent 7dd3f17 commit 4b79cac

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

content/manuals/build/building/secrets.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,13 @@ $ docker build \
264264
--secret id=GIT_AUTH_HEADER.gitlab.com,env=GITLAB_AUTH_HEADER \
265265
https://github.com/example/todo-app.git
266266
```
267+
268+
## HTTP authentication for `COPY` and `ADD`
269+
270+
To use secrets in `COPY` or `ADD` commands, you can create
271+
`HTTP_AUTH_TOKEN_<host>` or `HTTP_AUTH_HEADER_<host>` secrets for use when
272+
accessing the specified host. For example `HTTP_AUTH_TOKEN_127.0.0.1=token` will
273+
make requests to `127.0.0.1` add a header `Authorization: Bearer token`.
274+
275+
These variables follow the same convention as the [Git HTTP authentication
276+
scheme](#http-authentication-scheme) handling.

0 commit comments

Comments
 (0)