使用 docker compose 开发中出现的问题及解决

主要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)