Mapping port to access webinterface
Clash 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.
docker port-forwarding
add a comment |Â
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.
docker port-forwarding
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
add a comment |Â
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.
docker port-forwarding
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.
docker port-forwarding
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered Jul 27 at 8:33
slmâ¦
232k65479649
232k65479649
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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