Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if the required variable is not specified #4402

Open
Wintreist opened this issue Oct 21, 2024 · 1 comment
Open

Error if the required variable is not specified #4402

Wintreist opened this issue Oct 21, 2024 · 1 comment
Milestone

Comments

@Wintreist
Copy link

Wintreist commented Oct 21, 2024

compose.yaml

  postgres:
    image: postgres:17-alpine
    restart: always
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?error}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_INITDB_WALDIR=${POSTGRES_INITDB_WALDIR}
    ports:
      - ${POSTGRES_PORT}:${POSTGRES_PORT}

All variables are specified in the .env file, except for POSTGRES_PASSWORD.
the .env file is located in the same directory as compose.yaml.
If, with the Docker extension installed, click on compose.bml right-click and select "Select services", then:
2024-10-21 20:40:15.591 [info] Error: Process exited with code 15
Maybe you could add in future updates the ability to set the value of variables when launching the service through the Vs code dialog box, and then suggest the past value of the variable at startup?

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Oct 23, 2024

This might be possible with Input Variables in VSCode's debugging and tasks framework, coupled with setting it to the environment. I'm not sure without investigating if the second part is possible but you might be able to find a way with input variables.

@dbreshears dbreshears added this to the 1.31.0 milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants