Description
In docker-compose.yml, runtime environment variables may be defined in .env files. But at build time, secrets can't be sourced from an .env file. They must be defined in an environment variable or in a dedicated text file on the host.
I'm using the following setup to try to mitigate the effect of any supply chain attacks on my development environment:
My choices for build secrets are currently:
- Load them into my host's environment
- Place them in individual files
Both leave them open to a malicious process on the host, and neither works with 1Password to give me an auth screen on access. It would be nice to be able to define a secret like this:
secrets:
github_token:
file: ./my_secrets.env
key: GH_TOKEN
Then I would be prompted to grant access to the token automatically when VS Code sends docker compose a build command.
Description
In
docker-compose.yml, runtime environment variables may be defined in.envfiles. But at build time, secrets can't be sourced from an.envfile. They must be defined in an environment variable or in a dedicated text file on the host.I'm using the following setup to try to mitigate the effect of any supply chain attacks on my development environment:
.envfile behind an auth dialog.docker compose buildcommands and doesn't allow passing alternate build arguments.My choices for build secrets are currently:
Both leave them open to a malicious process on the host, and neither works with 1Password to give me an auth screen on access. It would be nice to be able to define a secret like this:
Then I would be prompted to grant access to the token automatically when VS Code sends
docker composea build command.