images icon indicating copy to clipboard operation
images copied to clipboard

miniconda image does not install from environment.yml

Open tvoipio opened this issue 1 year ago • 2 comments

https://github.com/devcontainers/images/blob/9bb5c4f0540a9a54b0d4ea4151b737c7af2f8aec/src/miniconda/README.md?plain=1#L106

Running VS Code 1.86.0 with Dev Containers v0.338.1.

Including an environment.yml does not actually update the base environment when the dev container is rebuilt, when .devcontainer/devcontainer.json is the following:

{
	"name": "Python 3",
	"image": "mcr.microsoft.com/devcontainers/miniconda:0.203-3"
}

This seems logical in retrospect, as the local environment.yml has not been present when the image is built.

tvoipio avatar Feb 19 '24 12:02 tvoipio

Hi 👋

Thanks for reporting!

@gauravsaini04 Can you take a look and investigate this issue? Thanks!

samruddhikhandale avatar Feb 21 '24 17:02 samruddhikhandale

This seems logical in retrospect, as the local environment.yml has not been present when the image is built.

@tvoipio Yes, your understanding is correct.

If you want to update the base environment when the dev container is rebuilt, you need to specify the postCreateCommand in the devcontainer.json file to update the environment using the environment.yml file.

{
	"name": "Python 3",
	"image": "mcr.microsoft.com/devcontainers/miniconda:0.203-3",
         "postCreateCommand": "conda env update --file environment.yml"
}

Let us know if you are running into any issues, thanks!

samruddhikhandale avatar Feb 28 '24 18:02 samruddhikhandale