-
Notifications
You must be signed in to change notification settings - Fork 272
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
Docker-Compose: Support --env-file option #4885
Comments
Adding support for |
yes, sounds good, however the documentation suggest that it "just somehow magically works" |
I have a similar problem. I'm using Docker Desktop, when using Docker Compose V2, I had to change the location of So, I would like to be able to load |
I want to load an .env file at build time without docker-compose, this seems not possible atm ? |
@fyyyyy Correct, we don't have the env-file option yet and, unlike docker-compose, the docker CLI does not read the |
Ok, nevermind. So env-file is only supported at runtime by docker cli, not at build time.
|
❓ It would be nice if VScode devcontainer.json supports reading build args from a file. So we won't need this workaround As this is off-topic ( I'm not using docker-compose), i've created a new feature request #5475 |
vscode executes When you place an empty Two nice side-effects:
my "dockerComposeFile": [
"../../docker-compose.yml",
"../../environments/dev_local/postgres/docker-compose.yml",
"./docker-compose.yml"
], The docker-compose.yml in the root folder is this: version: '3.8'
# intentionally empty What makes it a bit quirky is that the paths of the It is just a work-around. I think a proper solution is needed in |
To add to the feature request ... I think just adding a method to provide the As it is already established for the "Image and Dockerfile Scenario" a similar approach to control and externalize key settings in the "Docker Compose Scenario" would be needed. Just for comparison: This is how a "build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.10-bullseye",
"NODE_VERSION": "lts/*"
},
},
"runArgs": [ "--env-file=../.env" ] similar methods to specifiy |
So my needs align more with (#5324) which was closed as a duplicate and now this issues title "using --env-file" may not. Let me explain. I would like our base .devcontainer folder to work for Codespaces and our CI/CD via GitHub Actions (using devcontainers/ci). As such, the devcontainer.json would leverage a
# .devcontainer/docker-compose-local.yml
services:
oracle:
image: hello-world
restart: "no"
volumes: [] # .devcontiner/.env
COMPOSE_FILE=docker-compose.yml:docker-compose-local.yml Would the solutions proposed here help me with that or should we open this back up? |
Hi,
want have a multi container app ( db, python, react).
I want to run it locally in docker, and connect to the python as well as to the react container.
The last obstacle is the automatically generated "compose project name" which is different.
Following the documentation i created a .env file to create a name for docker compose.
otherwise the 2nd. open folder in container would fire up a complete new compose stack.
Unfortunately when i follow this documentation, i had to create copy of .env file in the folder wich i opened with the 2nd windows in the container. Probably because then the subfolder is then considered as project root.
Kind regards
The text was updated successfully, but these errors were encountered: