如果 Ubuntu 20.04 抱怨地址已被使用,我该如何启动 docker?我试过
docker-compose up -d
Starting relaatiotietokannat_db_1 ...
Starting relaatiotietokannat_db_1 ... error
ERROR: for relaatiotietokannat_db_1 Cannot start service db: driver failed programming external connectivity on endpoint relaatiotietokannat_db_1 (02444b3d0c2841a4fe702cf2705fbd5a869e44e7f258ecfbcea764ead989fcb4): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint relaatiotietokannat_db_1 (02444b3d0c2841a4fe702cf2705fbd5a869e44e7f258ecfbcea764ead989fcb4): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
ERROR: Encountered errors while bringing up the project.
答案1
该错误表明该端口3306
已被另一个进程使用。您必须停止该进程并释放端口,或者告诉docker
使用另一个端口。您可以3306
通过执行以下命令找出当前正在使用端口的进程netstat -lntep |grep 3306