Search code examples
dockervisual-studio-codedocker-composevscode-remote

Problem with reopening of the project in container


I have ran into this problem when opening the project in container.

Setting up container for folder or workspace: c:\Work\playground\moodle\lms_administrace
Run: docker-compose -f c:\Work\playground\moodle\lms_administrace\docker\docker-compose-dev.yml config --services
app
redis
db
phpmyadmin
Run: docker-compose --project-name docker -f c:\Work\playground\moodle\lms_administrace\docker\docker-compose-dev.yml up -d --build
Creating volume "docker_mysql_data_volume" with default driver
Pulling app (nodejs:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]

The problem is that I cannot press y or N. I know why I'm having this problem - because I have used that docker compose file before and containers and volumes were created with the directory prefix (docker).

There's a way how to change the compose project name through .env file, but it does not work (I put the file in the root directory, in the directory where compose file is, and in the .devcontainer folder). And also there is -p parameter, but the MS GitHub page does not provide any information.

I can probably fix it by renaming everything, but this may be a serious issue since you can't continue in the process ...

Did anybody experienced similar problem and fixed that?

Thanks,

Karel


Solution

  • You probably mistyped service docker image name in docker-compose.yml.

    You are trying to pull nodejs image instead of node

    Also, there is could be same error with case postgresql and postgres.