Skip to content

Support updated env file format #4842

@mrmachine

Description

@mrmachine
  • VSCode Version:

    Version: 1.55.0 (Universal)
    Commit: c185983a683d14c396952dd432459097bc7f757f
    Date: 2021-03-30T16:01:05.981Z
    Electron: 11.3.0
    Chrome: 87.0.4280.141
    Node.js: 12.18.3
    V8: 8.7.220.31-electron.0
    OS: Darwin arm64 20.3.0
    
  • Local OS Version: macOS Big Sur 11.2.3 (20D91)

  • Remote OS Version: Ubuntu 20.04 LTS

  • Remote Extension/Connection Type: Docker

Steps to Reproduce:

  1. Create a .env file in the project root with export COMPOSE_PROJECT_NAME='foo' inside.

  2. Choose Remote-Containers: Rebuild and Reopen in Container

  3. Watch the log. It will include a line like this:

    [1437 ms] Start: Run: docker-compose --project-name BASE_DIR_NAME -f /Users/me/path/to/BASE_DIR_NAME/docker-compose.yml -f /Users/me/path/to/BASE_DIR_NAME/.devcontainer/docker-compose.devcontainer.yml up -d --build
    

Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A

NOTE: COMPOSE_PROJECT_NAME=foo inside the .env file DOES work. VS Code will then execute docker-compose --project-name foo ... But export FOO='BAR' has been supported by Docker Compose since version 1.26, and allows the .env file to include inline comments and be more compatible and portable (e.g. can be sourced by bash).

Metadata

Metadata

Assignees

Labels

containersIssue in vscode-remote containersfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions