Skip to content

Source build secrets from .env files #14089

Description

@jamesgecko

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions