forget for get

覚えるために忘れる

dockerコンテナが起動しない

WARNING: Host is already in use by another container
ERROR: for api  Cannot start service api: driver failed programming external connectivity on endpoint docker_api_1 (e819fe...): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.

 

80番ポートが既に使われているっぽい

 

lsof -i:80
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
apache2 4666     root    4u  IPv6  38177      0t0  TCP *:http (LISTEN)

 

apache2がいた!

 

apache2を停止する。
自動起動も無効にする。

 

service apache2 stop
systemctl disable apache2
docker-compose up
Starting docker_api_1         ... done

起動できた!