My Docker Compose uses environment variables inline.
ddb-startup:
depends_on:
dynamodb:
condition: service_healthy
image: ${AWS_CLI_IMAGE}:${AWS_CLI_VERSION}
This is my file .env.docker
AWS_CLI_IMAGE=amazon/aws-cli
AWS_CLI_VERSION=2.33.2
I have a Makefile target which runs this command: docker compose up --env-file .env.docker and it works great.
However, when I click the "Run Service" button in VS Code, I get this error:
* Executing task: docker compose -f 'docker-compose.yml' up -d --build 's3mock'
WARN[0000] The "AWS_CLI_IMAGE" variable is not set. Defaulting to a blank string.
WARN[0000] The "AWS_CLI_VERSION" variable is not set. Defaulting to a blank string.
unable to get image ':': Error response from daemon: invalid reference format
It would be nice if there was a config option in settings.json to point to a custom --env-file flag. Otherwise I am unable to use this feature.
Edit: It seems like the issue is that --env-file is not one of the supported flags that is passed in, according to https://github.com/microsoft/vscode-containers/blob/main/src/commands/selectCommandTemplate.ts#L81
I do apologize if I'm in the wrong repo as I'm not fully sure the different between vscode-docker and vscode-containers
My Docker Compose uses environment variables inline.
This is my file
.env.dockerI have a Makefile target which runs this command:
docker compose up --env-file .env.dockerand it works great.However, when I click the "Run Service" button in VS Code, I get this error:
It would be nice if there was a config option in
settings.jsonto point to a custom--env-fileflag. Otherwise I am unable to use this feature.Edit: It seems like the issue is that
--env-fileis not one of the supported flags that is passed in, according to https://github.com/microsoft/vscode-containers/blob/main/src/commands/selectCommandTemplate.ts#L81I do apologize if I'm in the wrong repo as I'm not fully sure the different between
vscode-dockerandvscode-containers