-
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
vscode-dev-containers: it appears that the behavior of initializeCommand has changed #7377
Comments
I'm seeing this same issue as well. Reverting |
Same here |
Could you append the log? ( |
Example failed log:
|
What has changed is that we now need to look up the image or Dockerfile in the docker-compose.yml in order to read the image metadata from the base image, so we can compute the complete configuration of the dev container. (The image metadata is new.) To read the docker-compose.yml we use I suggest you update your setup such that |
Others who are affected by this change may have different needs for The My current workaround is to create a wrapper over #!/bin/bash
if test -d .devcontainer;
then
touch .devcontainer/.env.container
fi
/usr/bin/docker-compose.orig "$@" As for the usefulness of |
For reference, below are the results of a quick search where it's suggested to create a The documentation for
If this is going to remain a permanent change, then I suggest two things:
|
Please let us hear whether a solution for injecting sensitive values or variables dynamically into docker-compose.yml will be supported by vscode remote-containers. An older issue used The method of dynamically injecting possibly sensitive values will need to rely on vscode only, and not a presence of environment variables in a terminal session, since people may start vscode from a launcher and not terminal. |
I just realized that we can skip reading the full config when there is an initializeCommand. (This won't allow us to check host requirement passed down from the base image upfront, but I think that's acceptable in this case.) |
Why was this closed? AFAICT initializeCommand is not working. We were using this to generate .devcontainer/.env which seems to be the crux of this bug report. Is initializeCommand fixed, or has the documentation been updated, or am I missing a workaround that explains how .env is supposed to be created now? |
@dBotLFG I closed it when I added a fix to the code. I'll let you know when the fix is available in a new pre-release version, so you can give it a try. Thanks. |
This fix is available in Dev Containers 0.264.0-pre-release. Let me know if that fixes this issue for you. Thanks. |
Yes, that fixed the issue for me. initializeCommand is now able to dynamically create .devcontainer/.env for use with docker-compose.yml with the fix you provided in 0.264.0-pre-release . Thank you very much |
0.255.4 of https://github.com/microsoft/vscode-dev-containers - the tag is missing in github see Some releases/tags are missing on vscode-dev-containers github #7376
Steps to Reproduce:
It appears that
initializeCommand
changed the behavior somewhere between0.251.0
(good) and0.255.2
(bad) release of https://github.com/microsoft/vscode-dev-containers. This seems to be the same issue as #7366.before any fresh start of
code .
, remove the file and vscode docker volumecode .
from the root of this directory and allow for "Reopen in Container". A popup with "An error occurred setting up the container" appears. More logs are povided in theLogs
section above. A successful container will start, and have theKEY=VALUE
among its environment variables.Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Cannot disable the vscode-dev-containers extension, since it is needed to demonstrate the problem
The text was updated successfully, but these errors were encountered: