What to do if you get a port error when docker-compose up on Mac

What is this?

The following error occurred when trying to start the container with docker-compose up, so the remedy is described.

Starting lb ... error
ERROR: for lb  Cannot start service lb: Ports are not available: listen tcp 0.0.0.0:80: bind: address already in use

Cause and remedy

Literally, it cannot be used because another application is using port 80. So look for the process that is using the port.

$ sudo lsof -i -P | grep ":80"

It turns out that httpd is using port 80.

httpd      103            root    4u  IPv6 0xb54e8c868de16e45      0t0    TCP *:80 (LISTEN)
httpd     1221            _www    4u  IPv6 0xb54e8c868de16e45      0t0    TCP *:80 (LISTEN)
com.docke 2202 ishiharanaohiro   83u  IPv6 0xb54e8c868494ae45      0t0    TCP *:8025 (LISTEN)

Delete the PID (103, 1221) for httpd.

$ kill -l 103
$ kill -l 1221

Start safely with docker-compose up -d. Congratulations!

Starting lb ... done

Recommended Posts

What to do if you get a port error when docker-compose up on Mac
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get a gcc error in Docker
What to do if you get a DISPLAY error in gym.render ()
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do if you get an error when you hit Heroku logs
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you go offline due to SSL certificate error when running Jenkins on Mac
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get an error on heroku rake db: migrate
What to do if you get a java.io.IOException in GlassFish
What to do if you get a wrong number of arguments error in binding.pry
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do when you run into a docker-compose node_modules problem
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
What to do if you get a "302" error in your controller unit test code in Rails
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get an error during rails db: reset
What to do if you get an uninitialized constant Likes Controller error
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
What to do if you accidentally create a model
What to do when a null byte error occurs
What to do if you get the error message unrecognized selector send to instance "***"
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What to do if you get the error Couldn't find Item without an ID
What to do if mysql2 gets a bundle install error
[Rails] What to do if you can't get an error message with the errors method
What to do if you get an error in Basic authentication during Rails test code
What to do if you get angry with OpenSSL with pyenv install
What to do when you become a Problem During Content Assist
[Rails] What to do if you can't get parameters with form_with
What to do when a javax.el.PropertyNotWritableException occurs
What to do if you install Ubuntu
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if you get "Changes not staged for commit:" when you git status after git add.
[Android Studio] What to try when you get into error spitting hell
What to do if an error occurs when nokogiri enters when bundle install
no space left on device What to do if an error occurs
Notes on what to do when EC2 is set up with t2.micro
What to do when "call'Hoge.connection' to establish a connection" appears on rails c
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What do you use when converting to String?
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if you get Application with name appName is already registered. When you try to start GlassFish
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do when you want to delete a migration file that is "NO FILE"
What to do if you get Could not locate Gemfile or .bundle / directory
<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
What to do if ClassNotFoundException occurs when starting Tomcat
What to do if TextToSpeech doesn't work on Android 11
What to do when rails creates a 〇〇 2.rb file
What to do if an ActionController :: UnknownFormat error occurs
What to see when IntelliJ doesn't start on Mac
Error ExecJS :: RuntimeUnavailable: What to do when it occurs