Closed duchuyvp closed 5 months ago
A couple of thoughts:
${env:GITHUB_TOKEN}
and launching VSCode with that environment variable set (i.e. set it as a system environment variable or launch from a terminal with that environment variable set).${env:FOO}
replacement implemented for our tasks, I thought we did.This has been released in Docker extension version 1.29.0.
First, here is my
.vscode/tasks.json
:I want to pass
GITHUB_TOKEN
with--build-arg
to install a private module when running the build, but it seems not to read the.env
file.When I set
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
, the executed command is:docker image build --pull --file 'workspaceFolder/Dockerfile' --tag 'service:latest' --label 'com.microsoft.created-by=visual-studio-code' --build-arg 'GITHUB_TOKEN=${GITHUB_TOKEN}' 'workspaceFolder'
And when I set
"GITHUB_TOKEN": "${env:GITHUB_TOKEN}"
, the executed command is:docker image build --pull --file 'workspaceFolder/Dockerfile' --tag 'service:latest' --label 'com.microsoft.created-by=visual-studio-code' --build-arg 'GITHUB_TOKEN=' 'workspaceFolder'
(GITHUB_TOKEN is an empty string)I think it's not an issue; it may not be supported yet. So, is there an alternative way to build with arguments from the .env file?