4

I have running docker container on one computer (in this container I start tomcat and mysql server) and want connect to this container from another computer in local network. How I can this do?

Vladimir
  • 51
  • 1
  • 4
  • This example (and from official docs) work if using version docker 18.0.9 ( on one my macbook I have "docker for mac" and if I run app here, I don't have any problems, but if I run my app on old macbook, where did install "docker toolbox", I can't get access to container where running tomcat). – Vladimir Mar 21 '19 at 23:08

1 Answers1

0

Examples:

docker run -it --rm -p 0.0.0.0:80:80 image

or

docker run -it --rm --network host image

The second option will expose everything inside a container, you can read about it here. I would not advise to use it, except for test purposes.

The first option will attach 80 port on the host system to 80 port inside the container. You can read about it here.

Please, before asking such questions, read the official manual

halfer
  • 19,824
  • 17
  • 99
  • 186
Dmitrii
  • 877
  • 1
  • 6
  • 12