我正在使用构建秘密提供诗歌认证,但它没有被安装到环境中,我从docker 文档中复制并修改了示例。
export DOCKER_BUILDKIT=1
docker build \
--secret id=poetry_johndoe_auth_username,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_USERNAME \
--secret id=poetry_johndoe_auth_password,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_PASSWORD \
-t example:latest .
在dockerfile中我正在安装到环境中
RUN --mount=type=secret,id=poetry_johndoe_auth_username,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_USERNAME \
--mount=type=secret,id=poetry_johndoe_auth_password,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_PASSWORD \
pip install -r /tmp/requirements.txt
CI 返回以下错误
Dockerfile:17
--------------------
16 |
17 | >>> RUN --mount=type=secret,id=poetry_johndoe_auth_username,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_USERNAME \
18 | >>> --mount=type=secret,id=poetry_johndoe_auth_password,env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_PASSWORD \
19 | >>> pip install -r /tmp/requirements.txt
20 |
--------------------
ERROR: failed to solve: unexpected key 'env' in 'env=POETRY_HTTP_BASIC_JOHNDOE_GITLAB_USERNAME'