everyone.
I had a similar issue, but I wasn't able to identify if something was using the port 5432.
That was the way that I solved the issue:
- I used sudo ss -tulwn | grep LISTEN
➜ xxxx-xxxx-xxxxxx git:(main) sudo ss -tulwn | grep LISTEN
tcp LISTEN 0 244 127.0.0.1:5432 0.0.0.0:*
tcp LISTEN 0 511 127.0.0.1:35613 0.0.0.0:*
tcp LISTEN 0 100 127.0.0.1:49152 0.0.0.0:*
tcp LISTEN 0 128 127.0.0.1:30800 0.0.0.0:*
tcp LISTEN 0 128 127.0.0.1:30900 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
tcp LISTEN 0 5 127.0.0.1:631 0.0.0.0:*
tcp LISTEN 0 5 [::1]:631 [::]:*
- docker container ls (just checking)
➜ xxxx-xxxx-xxxxxx git:(main) docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- docker ps -a (just checking)
➜ xxxx-xxxx-xxxxxx git:(main) docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- docker network prune
➜ xxxx-xxxx-xxxxxx git:(main) docker network prune
WARNING! This will remove all custom networks not used by at least one container.
After that, docker-compose down and docker-compose up --build works
And I was happy using docker... until now.
My next steps:
Configure container's environment for the first time
- Run docker-compose run —rm web bash in a separate terminal pane/window. You should now be inside container, which is
indicated by showing you a hashtag before commands.
- Run rails db:create within container.
- Run rails db:migrate within container.
Run the environment seeds (if you want to)
- Run rails db:seed.