buildkit
buildkit copied to clipboard
Build secret mount destination not created when specified with a build argument
My Dockerfile directives look like:
ARG SECRET_PATH=/my/secret/path
RUN --mount=type=secret,id=mysecret,dst=${SECRET_PATH} \
cat ${SECRET_PATH}
This errors out as cat: /my/secret/path: No such file or directory
when built with DOCKER_BUILDKIT=1 docker build --secret id=mysecret,src=mysecret.txt .
It does work correctly when simply hardcoded as RUN --mount=type=secret,id=mysecret,dst=/my/secret/path ...
.
Can anybody reproduce this? If not possible now, is there a reason why this isn't already supported? It doesn't really matter that much obviously because it doesn't affect the container at runtime and it can be all hardcoded but I was confused for a while why this wasn't working and thought I'd file an issue.
What version of Dockerfile are you using. Variables were added in 1.2 iirc.