Mapping port to access webinterface

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I have a barebones server, running Linux, but no graphical interface is installed. It's only working in command line and we don't want to change that.



The IP address of this server is 192.168.1.6



On this machine we run Docker to use multi containers. One of the container is a web app accessible by port 80.



When I curl localhost on my barebones Linux I have the raw data of the webpage. I would like to see the web app from every computer on the same LAN. By example on machine 192.168.1.7, I would like to type in a browser 192.168.1.6 and see the web app.



First of all, is it possible? If yes, can you provide me some guidelines?
Sorry if the answer might seems obvious, but I'm starting to learn this field.







share|improve this question





















  • This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
    – slm♦
    Jul 27 at 7:45











  • Official docs as well - docs.docker.com/network/network-tutorial-host
    – slm♦
    Jul 27 at 7:55
















up vote
1
down vote

favorite












I have a barebones server, running Linux, but no graphical interface is installed. It's only working in command line and we don't want to change that.



The IP address of this server is 192.168.1.6



On this machine we run Docker to use multi containers. One of the container is a web app accessible by port 80.



When I curl localhost on my barebones Linux I have the raw data of the webpage. I would like to see the web app from every computer on the same LAN. By example on machine 192.168.1.7, I would like to type in a browser 192.168.1.6 and see the web app.



First of all, is it possible? If yes, can you provide me some guidelines?
Sorry if the answer might seems obvious, but I'm starting to learn this field.







share|improve this question





















  • This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
    – slm♦
    Jul 27 at 7:45











  • Official docs as well - docs.docker.com/network/network-tutorial-host
    – slm♦
    Jul 27 at 7:55












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have a barebones server, running Linux, but no graphical interface is installed. It's only working in command line and we don't want to change that.



The IP address of this server is 192.168.1.6



On this machine we run Docker to use multi containers. One of the container is a web app accessible by port 80.



When I curl localhost on my barebones Linux I have the raw data of the webpage. I would like to see the web app from every computer on the same LAN. By example on machine 192.168.1.7, I would like to type in a browser 192.168.1.6 and see the web app.



First of all, is it possible? If yes, can you provide me some guidelines?
Sorry if the answer might seems obvious, but I'm starting to learn this field.







share|improve this question













I have a barebones server, running Linux, but no graphical interface is installed. It's only working in command line and we don't want to change that.



The IP address of this server is 192.168.1.6



On this machine we run Docker to use multi containers. One of the container is a web app accessible by port 80.



When I curl localhost on my barebones Linux I have the raw data of the webpage. I would like to see the web app from every computer on the same LAN. By example on machine 192.168.1.7, I would like to type in a browser 192.168.1.6 and see the web app.



First of all, is it possible? If yes, can you provide me some guidelines?
Sorry if the answer might seems obvious, but I'm starting to learn this field.









share|improve this question












share|improve this question




share|improve this question








edited Jul 27 at 7:44









slm♦

232k65479649




232k65479649









asked Jul 27 at 7:33









Raccoon

1403




1403











  • This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
    – slm♦
    Jul 27 at 7:45











  • Official docs as well - docs.docker.com/network/network-tutorial-host
    – slm♦
    Jul 27 at 7:55
















  • This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
    – slm♦
    Jul 27 at 7:45











  • Official docs as well - docs.docker.com/network/network-tutorial-host
    – slm♦
    Jul 27 at 7:55















This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
– slm♦
Jul 27 at 7:45





This shows all the ways - blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker. If you just want to get started see here - forums.docker.com/t/….
– slm♦
Jul 27 at 7:45













Official docs as well - docs.docker.com/network/network-tutorial-host
– slm♦
Jul 27 at 7:55




Official docs as well - docs.docker.com/network/network-tutorial-host
– slm♦
Jul 27 at 7:55










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










There are many ways to do this the most straightforward is to use Docker's built in networking.



$ docker network ls
NETWORK ID NAME DRIVER SCOPE
6ef2c6836690 bridge bridge local
db24b1e2be58 host host local
edf606d533a5 none null local


By default your container goes into the bridge network, unless you tell it otherwise during the docker run....



$ docker run -P -d -p 12345:80 nginxdemos/hello


Once you do this any host on the LAN can reach it using the IP of the Docker Host + the port:



$ curl -I http://192.168.56.101:12345/
HTTP/1.1 200 OK
Server: nginx/1.13.8
Date: Fri, 27 Jul 2018 08:26:02 GMT
Content-Type: text/html
Connection: keep-alive
Expires: Fri, 27 Jul 2018 08:26:01 GMT
Cache-Control: no-cache


Firewalls



Keep in mind that you're Docker Host's firewall may be the cause of traffic not ingressing/egressing to/from the Docker container. In some situations, you may need to add the Docker Host's port (12345 in my example above) to an allow list so that hosts outside of Docker Host can access this port.



References



  • Connecting Docker Containers, Part One

  • Docker networking overview

  • Docker - Use bridge networks

  • How To Set Up a Firewall Using FirewallD on CentOS 7

  • nginx container

  • nginxdemos/hello container





share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458773%2fmapping-port-to-access-webinterface%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    There are many ways to do this the most straightforward is to use Docker's built in networking.



    $ docker network ls
    NETWORK ID NAME DRIVER SCOPE
    6ef2c6836690 bridge bridge local
    db24b1e2be58 host host local
    edf606d533a5 none null local


    By default your container goes into the bridge network, unless you tell it otherwise during the docker run....



    $ docker run -P -d -p 12345:80 nginxdemos/hello


    Once you do this any host on the LAN can reach it using the IP of the Docker Host + the port:



    $ curl -I http://192.168.56.101:12345/
    HTTP/1.1 200 OK
    Server: nginx/1.13.8
    Date: Fri, 27 Jul 2018 08:26:02 GMT
    Content-Type: text/html
    Connection: keep-alive
    Expires: Fri, 27 Jul 2018 08:26:01 GMT
    Cache-Control: no-cache


    Firewalls



    Keep in mind that you're Docker Host's firewall may be the cause of traffic not ingressing/egressing to/from the Docker container. In some situations, you may need to add the Docker Host's port (12345 in my example above) to an allow list so that hosts outside of Docker Host can access this port.



    References



    • Connecting Docker Containers, Part One

    • Docker networking overview

    • Docker - Use bridge networks

    • How To Set Up a Firewall Using FirewallD on CentOS 7

    • nginx container

    • nginxdemos/hello container





    share|improve this answer

























      up vote
      0
      down vote



      accepted










      There are many ways to do this the most straightforward is to use Docker's built in networking.



      $ docker network ls
      NETWORK ID NAME DRIVER SCOPE
      6ef2c6836690 bridge bridge local
      db24b1e2be58 host host local
      edf606d533a5 none null local


      By default your container goes into the bridge network, unless you tell it otherwise during the docker run....



      $ docker run -P -d -p 12345:80 nginxdemos/hello


      Once you do this any host on the LAN can reach it using the IP of the Docker Host + the port:



      $ curl -I http://192.168.56.101:12345/
      HTTP/1.1 200 OK
      Server: nginx/1.13.8
      Date: Fri, 27 Jul 2018 08:26:02 GMT
      Content-Type: text/html
      Connection: keep-alive
      Expires: Fri, 27 Jul 2018 08:26:01 GMT
      Cache-Control: no-cache


      Firewalls



      Keep in mind that you're Docker Host's firewall may be the cause of traffic not ingressing/egressing to/from the Docker container. In some situations, you may need to add the Docker Host's port (12345 in my example above) to an allow list so that hosts outside of Docker Host can access this port.



      References



      • Connecting Docker Containers, Part One

      • Docker networking overview

      • Docker - Use bridge networks

      • How To Set Up a Firewall Using FirewallD on CentOS 7

      • nginx container

      • nginxdemos/hello container





      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        There are many ways to do this the most straightforward is to use Docker's built in networking.



        $ docker network ls
        NETWORK ID NAME DRIVER SCOPE
        6ef2c6836690 bridge bridge local
        db24b1e2be58 host host local
        edf606d533a5 none null local


        By default your container goes into the bridge network, unless you tell it otherwise during the docker run....



        $ docker run -P -d -p 12345:80 nginxdemos/hello


        Once you do this any host on the LAN can reach it using the IP of the Docker Host + the port:



        $ curl -I http://192.168.56.101:12345/
        HTTP/1.1 200 OK
        Server: nginx/1.13.8
        Date: Fri, 27 Jul 2018 08:26:02 GMT
        Content-Type: text/html
        Connection: keep-alive
        Expires: Fri, 27 Jul 2018 08:26:01 GMT
        Cache-Control: no-cache


        Firewalls



        Keep in mind that you're Docker Host's firewall may be the cause of traffic not ingressing/egressing to/from the Docker container. In some situations, you may need to add the Docker Host's port (12345 in my example above) to an allow list so that hosts outside of Docker Host can access this port.



        References



        • Connecting Docker Containers, Part One

        • Docker networking overview

        • Docker - Use bridge networks

        • How To Set Up a Firewall Using FirewallD on CentOS 7

        • nginx container

        • nginxdemos/hello container





        share|improve this answer













        There are many ways to do this the most straightforward is to use Docker's built in networking.



        $ docker network ls
        NETWORK ID NAME DRIVER SCOPE
        6ef2c6836690 bridge bridge local
        db24b1e2be58 host host local
        edf606d533a5 none null local


        By default your container goes into the bridge network, unless you tell it otherwise during the docker run....



        $ docker run -P -d -p 12345:80 nginxdemos/hello


        Once you do this any host on the LAN can reach it using the IP of the Docker Host + the port:



        $ curl -I http://192.168.56.101:12345/
        HTTP/1.1 200 OK
        Server: nginx/1.13.8
        Date: Fri, 27 Jul 2018 08:26:02 GMT
        Content-Type: text/html
        Connection: keep-alive
        Expires: Fri, 27 Jul 2018 08:26:01 GMT
        Cache-Control: no-cache


        Firewalls



        Keep in mind that you're Docker Host's firewall may be the cause of traffic not ingressing/egressing to/from the Docker container. In some situations, you may need to add the Docker Host's port (12345 in my example above) to an allow list so that hosts outside of Docker Host can access this port.



        References



        • Connecting Docker Containers, Part One

        • Docker networking overview

        • Docker - Use bridge networks

        • How To Set Up a Firewall Using FirewallD on CentOS 7

        • nginx container

        • nginxdemos/hello container






        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Jul 27 at 8:33









        slm♦

        232k65479649




        232k65479649






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458773%2fmapping-port-to-access-webinterface%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?