-
Notifications
You must be signed in to change notification settings - Fork 302
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
initializeCommand should run before docker-compose config #7366
Comments
Could you append the log? ( |
Having the same issue. Thanks for |
|
Update: The current workaround I have is to leave the env file blank, and the initialize command will fill it out. Which has its own set of issues because adding an empty file to git and have it not be tracked is another issue. This actually didn't work. Made a mistake in testing. So as far as I know there isn't a workaround. Going to try and use
|
The fix from #7377 is available in Dev Containers 0.264.0-pre-release and later. Please give that a try. |
That appears to have worked. Thank you. I will subscribe to releases to see when I can roll this out to non-pre-release devs. For anyone else stuck on this my final solution worked well. docker-compose can use a .env file at a project level. So my initialize command wrote to
|
Hey @chrmarti, this issue might need further attention. @davidtlascelles, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
This issue is resolved, thanks. For posterity: if anyone finds themselves here with a similar issue, it may be related to your version of This is fixed by uninstalling the apt version of docker-compose and installing either the |
Type: Bug
Our team uses the
initializeCommand:
devcontainer.json key to generate an.env
file that is used by the Dev Container. Using the docker-composeenv_file:
key with a non-existent file causes thedocker-compose config
command in the startup sequence to fail, even though the.env
file will exist by the time the container runs.I found that I could work around this issue by using the devcontainer.json option:
"runArgs": ["--env-file",".devcontainer/.env"]
, but I believe the real solution is to run theinitializeCommand
before running any docker related commands, as there could be other reasons thedocker-compose config
command might fail even though theinitializeCommand
would have fixed the issues before the container launches.Interestingly, I found that using the devcontainer CLI tool,
devcontainer up --workspace-folder /path/to/workspace
resulted in the container successfully launching, so it seems that startup sequence is either ordered "correctly" by running the
initializeCommand
before docker commands, or it just doesn't run adocker-compose config
validation at all.Extension version: 0.255.3
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:15:18.074Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
The text was updated successfully, but these errors were encountered: