简体   繁体   English

在容器中重新打开项目的问题

[英]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 .问题是我不能按yN 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 ).我知道为什么我会遇到这个问题 - 因为我之前使用过 docker 撰写文件,并且容器和卷是使用目录前缀( 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).有一种方法可以通过.env文件更改 compose 项目名称,但它不起作用(我将文件放在根目录中,在 compose 文件所在的目录中,以及在.devcontainer文件夹中)。 And also there is -p parameter, but the MS GitHub page does not provide any information.还有-p参数,但是 MS GitHub 页面没有提供任何信息。

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卡雷尔

You probably mistyped service docker image name in docker-compose.yml.您可能在 docker-compose.yml 中输入错误的服务 docker 图像名称。

You are trying to pull nodejs image instead of node您正在尝试提取nodejs图像而不是node

Also, there is could be same error with case postgresql and postgres .此外,案例postgresqlpostgres可能存在相同的错误。

I had the same problem,My problem is using the wrong mirror name.我有同样的问题,我的问题是使用了错误的镜像名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM