I am very new to Docker. And I created an empty .net core website with docker support. (Visual Studio 17 adds docker support files to the solution and you can run debug etc.)
Everything is ok... then when I run my website, it always opens in a different IP Address: for example http://172.20.52.{{random.ip.here}}/
Now I need to be able to open it in http://localhost:5000
But when I try to map the port 5000:80
Every tutorial I found states that all you need to do is map the port of your host to the container. At this point could it be an issue with my container network.
More information:
I am using Docker for Windows, with a windows host.
my networks on docker:
If you want to do http://localhost:5000, the host port 5000 needs to map to container port 80. But in your container list screen shot, it's the host port 8028 mapping to container port 80. I think you should do http://localhost:8028 instead.
Related
I have a WcfService under .NET Framework, it is older server-side of application. I need to migrate it to the Windows Docker container on machine with Windows 10.
Beside that there will be running few IIS containers, that will interact with this WcfService but container to container communication is clear to me.
Then I have a client desktop application that must also be able to connect to the WcfService. In configuration file I specify Port and Hostname of wcfservice so I can connect.
This client may run on any machine within same LAN as WcfService container.
How should I construct command docker run <params> wcfservice and are there any other steps (firewall, Hyper-V settings,...) I need to do so that LAN can see this service and how can I retrieve hostname and port from this container?
I have a windows server 2016 machine which I have Jenkins running on. I wanted to install SonarQube. So have downloaded v7.1
I have managed to start sonarqube on the machine and can view the webserver at http://localhost:9000
I tried to view the page on a different machine using the IP address and port 9000, but this doesn't connect. Looking in the sonar.properties file I can see
Binding IP address. For servers with more than one IP address, this property specifies which
address will be used for listening on the specified ports.
By default, ports will be used on all IP addresses associated with the server. sonar.web.host=http://xx.xxx.xxxx.xxx
If I use http:// then sonarqube starts, but I can't see sonarqube from any other machine, if I don't use http:// (so just the ip) then it won't start with a bind error.
Has anyone experience of setting this up on windows?
Turns out it was something a lot simpler, the machine is being run on azure and there was no port 9000 endpoint
I'm using Docker for Mac Beta and it runs from spotlight.
Is there any way to run it from console or force to use any configuration file to specify ip address for docker host.
Right now it changing from 192.168.64.3 to 192.168.64.5 (each start of docker it can have any random IP)
probably I need to configure bridge interface?
com.docker.network.bridge.enable_ip_masquerade: true
com.docker.network.bridge.host_binding_ipv4: 0.0.0.0
Does anyone know how to do that?
You can connect to the Docker alpine host via unix socket but I have not been able to figure out how to bridge to the network.
The docs say:
Unfortunately, due to limtations in OSX, we’re unable to route traffic
to containers, and from containers back to the host.
Because of the way networking is implemented in Docker for Mac, you
cannot see a docker0 interface in OSX. This interface is actually
within HyperKit.
I am having difficulty getting Confluence running on windows server 2012 on port 80. (the machine in hosted in Azure which is why I need to run it on port 80 (i dont have access to other ports from where I am trying to use this)).
I believe something must be running on port 80 , though i did a netstat -y and didnt see anything.
I think its IIS any idea how I should kill that or what else could be causing confluence to not run on port 80?
*confluence works find on say port 8090 but i need to run it on port 80.
mind you I cant get confluence to run on port 80 on the local instance of windows server, never mind accessing it from another location thus i dont think this has anything to do with azure
running a
netstat -abn
shows nothing running on port 80. Im still not sure why I cant get confluence to work locally on port 80.
A virtual machine in Azure is not directly public accessible. You need to configure endpoints in the cloudservice (which acts as a loadbalancer).
So for instance you can configure a public endpoint port 80 on the cloudservice to point to your VM port 8090. See http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-set-up-endpoints/ for more information.
If the Endpoint is open on Azure to the VM then my advice would be to check the firewall settings on the host. Typically most ports are shut unless they are explicitly opened by installing a feature like IIS (windows web server).
I've followed the tutorial on the docker.io website here:
http://docs.docker.io/en/latest/examples/python_web_app/
How would I access this app from a browser on my host OS?
Docker Remote API provides a way of accessing your Docker images and containers and performing many operations on them, through your Browser.
Here is the link for Docker API v1.6 Documentation
Hope it helps.
The tutorial explains how this works:
WEB_PORT=$(sudo docker port $WEB_WORKER 5000)
Look up the public-facing port which is NAT-ed. Find the private port used by the container and store it inside of the WEB_PORT variable.
# install curl if necessary, then ...
curl http://127.0.0.1:$WEB_PORT
Hello world!
Access the web app using curl. If everything worked as planned you should see the line “Hello world!” inside of your console.
Inside the container the application is listening on port 5000. This is translated automatically to an external port number accessible outside of the container. This makes sense because it allows multiple copies of your application to coexist on the same machine, each mapping port 5000 to a uniquely accessible port number for each app instance.
The documentation on port redirection has more details.