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

Port Mapping #20

Closed
sudhakarapn opened this issue Mar 2, 2021 · 3 comments
Closed

Port Mapping #20

sudhakarapn opened this issue Mar 2, 2021 · 3 comments

Comments

@sudhakarapn
Copy link

I am running two instances of the container.

Container 1 - working fine, listening to port 4000 and receiving metrics from MS SQL Server1
Container 2 - is not working since it is trying to listen to port 4000 though I have mapped to port 4001 by using the following command to listen to MS SQL Server2

docker run -e SERVER=192.168.56.101 -e USERNAME=SA -e PASSWORD=qkD4x3yy -e DEBUG=app -p 4001:4001 --name prometheus-mssql-exporter awaragi/prometheus-mssql-exporter

Please suggest.

@sudhakarapn sudhakarapn changed the title Port Mappintg Port Mapping Mar 2, 2021
@theKorzh
Copy link
Contributor

theKorzh commented Mar 3, 2021

It seems that you need to fix your docker command line to expose container port 4000 as host port 4001. Something like -p 4001:4000

@cobolbaby
Copy link

port: process.env["EXPOSE"] || 4000

@awaragi
Copy link
Owner

awaragi commented Mar 21, 2022

Dockerfile does not actually publish the port but only suggests to docker which ports will be available but it is up to the application based on configuration to actually make those ports actually functional and using the -p parameter will do the actual publishing.

As @cobolbaby suggested, you can map any external port to the same internal port such as -p 4001:4000 or -p 4002:4000 etc.

@awaragi awaragi closed this as completed Mar 21, 2022
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

4 participants