diff --git a/content/manuals/build/building/secrets.md b/content/manuals/build/building/secrets.md index fdaef1e9fea4..8d2c535c7cd0 100644 --- a/content/manuals/build/building/secrets.md +++ b/content/manuals/build/building/secrets.md @@ -264,3 +264,13 @@ $ docker build \ --secret id=GIT_AUTH_HEADER.gitlab.com,env=GITLAB_AUTH_HEADER \ https://github.com/example/todo-app.git ``` + +## HTTP authentication for `COPY` and `ADD` + +To use secrets in `COPY` or `ADD` commands, you can create +`HTTP_AUTH_TOKEN_` or `HTTP_AUTH_HEADER_` secrets for use when +accessing the specified host. For example `HTTP_AUTH_TOKEN_127.0.0.1=token` will +make requests to `127.0.0.1` add a header `Authorization: Bearer token`. + +These variables follow the same convention as the [Git HTTP authentication +scheme](#http-authentication-scheme) handling.