Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose up --- error #7

Closed
RadioOperator opened this issue Aug 28, 2023 · 4 comments
Closed

docker-compose up --- error #7

RadioOperator opened this issue Aug 28, 2023 · 4 comments

Comments

@RadioOperator
Copy link

RadioOperator commented Aug 28, 2023

hi, I run run docker-compose up -d to start the container, finally, got the error:

..........................................................................
...........................................................................

Step 11/11 : ENTRYPOINT ["/custom-run.sh"]
 ---> Running in 3efaa137c276
Removing intermediate container 3efaa137c276
 ---> 3e677487c272
Successfully built 3e677487c272
Successfully tagged grafana-mongodb-docker_prod:latest
WARNING: Image for service prod was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating grafana-mongodb-docker_prod_1 ... 
Creating grafana-mongodb-docker_prod_1 ... error

ERROR: for grafana-mongodb-docker_prod_1  Cannot start service prod: driver failed programming external connectivity on endpoint grafana-mongodb-docker_prod_1 (dbf0061c66e3d06739a3e7d7212b021cca0ce2b8c6ce480d2833d3af0f458244): Bind for 0.0.0.0:3000 failed: port is already allocated

ERROR: for prod  Cannot start service prod: driver failed programming external connectivity on endpoint grafana-mongodb-docker_prod_1 (dbf0061c66e3d06739a3e7d7212b021cca0ce2b8c6ce480d2833d3af0f458244): Bind for 0.0.0.0:3000 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

the 3000 port is using by Grafana default.

How to solve this, thanks.

@ajeje93
Copy link
Owner

ajeje93 commented Aug 28, 2023

It seems like you have something already running on port 3000, you can specify another port for the container in the ports section of docker-compose.yml.

You can find more info about port bindings for docker compose in the official documentation: https://docs.docker.com/compose/networking/

I'll close this issue for now as it's not related to the container itself.

@ajeje93 ajeje93 closed this as completed Aug 28, 2023
@RadioOperator
Copy link
Author

@ajeje93 Thanks. After I changed the port no to 3030:3030 from 3000:3000, the container of grafana-mongodb-docker_prod_1 is running.
But in Grafana dashboard, I cannot find the new Data Source, please help me again.

@ajeje93
Copy link
Owner

ajeje93 commented Aug 28, 2023

If you changed the port to 3030 you should access Grafana from that port. The container has both Grafana and the data source plugin inside.

I think you should change the port to something like 3030:3000 to map the port 3000 of the container (that is the Grafana port inside the container) to port 3030 of your PC, the access Grafana from http://localhost:3030.

@RadioOperator
Copy link
Author

@ajeje93 thanks. Got it!
the Grafana on http://localhost:3030.
and the data source on http://localhost:3000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants