主要Error:postgres: address already in use
~$ docker-compose up
Starting postgres_1 ...
Starting postgres_1 ... errorERROR: for postgres_1 Cannot start service postgres: driver failed programming external connectivity on endpoint postgres_1 (441b17e5a3567363bd250a210d718ad83ee5d50025b5e37ae1442c3a78618918): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in useERROR: for postgres Cannot start service postgres: driver failed programming external connectivity on endpoint postgres_1 (441b17e5a3567363bd250a210d718ad83ee5d50025b5e37ae1442c3a78618918): Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use
ERROR: Encountered errors while bringing up the project.
解决:
好像是本地的 postgres 服务占用了端口,停止本地服务就好:
sudo service postgresql stop
sudo update-rc.d postgresql disable # 使用上面的stop就可以停止,这句不是必须的
在使用Docker Compose进行开发时遇到端口被占用的错误,解决方案是检查并停止本地已运行的相关服务,释放所需端口。

4868

被折叠的 条评论
为什么被折叠?



