yonetmen
By:
yonetmen

Ip address without port not working

February 1, 2017 630 views
Docker

I run a docker container for my application. This is the command I used to get it worked:

docker run --name spring-boot -p 8080:8080 --link my-mysql-db:mysql -d username/image-name:latest

My application is up and running. I can navigate my app like this: http://111.22.222.222:8080 but it is not working if I type only http://111.22.222.222 without port number. How can I fix that?

Thank in advance!

1 Answer
Woet February 1, 2017
Accepted Answer

Because port 80 is the port used for HTTP. You can change it or use a webserver and proxy the requests.

  • I don't really get it. What do you mean by I can change it? I tried like this:

    docker run --name spring-boot -p 80:80 --link my-mysql-db:mysql -d username/image-name:latest
    

    Application starts up properly but I can't navigate the page. It's not working. This format: http://111.22.222.222 or http://111.22.222.222:80 does not opening the page.

  • Ok, I used like this and it worked.

    docker run --name spring-boot -p 80:8080 --link my-mysql-db:mysql -d username/image-name:latest
    

    Thanks!

Have another answer? Share your knowledge.