简体   繁体   English

我看不到在 ubuntu 20.04 上运行 docker compose 容器

[英]I can not see running docker compose containers on ubuntu 20.04

I have web app in 3 containers running on linux server (ubuntu 20.04), Django webapp, nginx webserver and postgres db.我在 linux 服务器(ubuntu 20.04)、Django webapp、nginx webserver 和 postgres db 上运行的 3 个容器中有 web 应用程序。 When i run 'docker-compose ps' it does not show any container.当我运行“docker-compose ps”时,它不显示任何容器。

I am sure that it is the right folder as there is no other docker-compose.yml on this server.我确定它是正确的文件夹,因为此服务器上没有其他 docker-compose.yml。

It seems almost like app is not running there except that it is accessible via browser and working well.似乎应用程序几乎没有在那里运行,只是它可以通过浏览器访问并且运行良好。

I tried all kinds of commands for showing containers or images using docker and docker compose with no result我尝试了各种命令来使用 docker 和 docker compose 显示容器或图像,但没有结果

I tried 'docker service restart' - app went offline for a moment and then back online (I have 'restart: allways' set in compose file) also I restarted whole server with same result.我尝试了“docker service restart”——应用程序离线了一会儿,然后又重新上线(我在撰写文件中设置了“restart: allways”)我也重新启动了整个服务器,结果相同。

Even script which is making db dumb does not see containers and started do fail即使是使 db 变得愚蠢的脚本也看不到容器并启动失败

When I try to bring up the project running 'docker-compose up' webapp and db containers starts but webserver not because port is already taken当我尝试启动运行“docker-compose up”的项目时,webapp 和 db 容器启动但 webserver 不是因为端口已被占用

Have anyone experienced this?有没有人经历过这个? I work with docker compose for a while but it never happend to me before, I dont know what to do, I need to update code of this application and I dont want to loose data in DB (I am also not able to make dump or ssh to container).我与 docker compose 一起工作了一段时间,但以前从未发生在我身上,我不知道该怎么做,我需要更新此应用程序的代码并且我不想丢失数据库中的数据(我也无法进行转储或SSH 到容器)。

Thanks.谢谢。

It sounds like there is some fundamental problem going on.听起来像是发生了一些根本性的问题。 Have you tried using simply docker ps to see if your containers are running, or to see if anything is running?您是否尝试过简单地使用docker ps来查看您的容器是否正在运行,或者查看是否有任何东西正在运行?

If the containers are listed in the docker ps output, make sure you have the names correct in your docker-compose.yml如果容器在docker ps输出中列出,请确保您docker-compose.yml的名称正确

If you don't see your containers running with docker ps then maybe they crashed immediately after start (and are therefore no longer running).如果您没有看到使用docker ps运行的容器,那么它们可能在启动后立即崩溃(因此不再运行)。

I would have expected docker-compose ps to have shown something - even if your containers are crashing.我本来希望docker-compose ps能显示一些东西——即使你的容器崩溃了。

Please provide more details of your output from docker ps and/or docker-compose ps and maybe the contents of your docker-compose.yml if these things don't help.如果这些事情没有帮助,请提供有关docker ps和/或docker-compose ps输出的更多详细信息,也许还docker-compose.yml的内容。 You said "it doesn't show any container" when you run docker-compose ps - does it show anything at all (errors, blank lines, etc.)您在运行docker-compose ps时说“它不显示任何容器”-它是否显示任何内容(错误、空行等)?

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

相关问题 为什么我的docker镜像在使用docker run(image)时没有运行,但是docker-compose生成的容器却可以跑起来? - Why is my docker image not running when using docker run (image), but i can run containers generated by docker-compose up? Docker Ubuntu 上的未知命令 bash 或 /bin/bash:20.04 与 docker-compose 版本 3.5 - Uknown command bash or /bin/bash on Docker Ubuntu:20.04 with docker-compose version 3.5 docker-compose有两个容器:Web无法连接到数据库 - docker-compose with two containers: web can not connect to db docker 同一网络上的容器(来自撰写)看不到对方 - docker containers on the same net (from compose) don't see each other 从 docker-compose 运行应用程序时出现 ModuleNotFoundError 错误。 我该如何解决这个问题? - Got ModuleNotFoundError error while running app from docker-compose. How can i solve this? 如何获取从另一个容器(Docker Compose)运行的RabbitMQ的IP地址? - How can I get the IP address of RabbitMQ running from another container (Docker Compose)? 运行 docker-compose 时出现权限错误 - When running docker-compose, I get a permission error 如何禁止使用 docker-compose 重新创建 docker 容器 - How to forbid recreating docker containers with docker-compose up 在docker-compose中运行Django - Running Django in docker-compose Docker 容器未运行 - Docker-compose - Docker container not running - Docker-compose
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM