简体   繁体   English

在我的Ubuntu 14.04上使用Docker(Web访问)

[英]Use Docker with my Ubuntu 14.04 (web access)

I've installed Docker on Ubuntu 14.04 by using repositories. 我已经使用存储库在Ubuntu 14.04上安装了Docker。 I have version 1.6.2 build 7c8fca2. 我有版本1.6.2 build 7c8fca2。

I've launch my image with command : 我用命令启动了我的形象:

docker run -p 80:80 -v /workspace/private/workbench/:/current private/client

This image launch a webserver I need to access... So I need the Docker's container's IP. 该映像启动了一个我需要访问的Web服务器...因此,我需要Docker容器的IP。

When I type : 当我输入时:

docker inspect 8f1526ff5287

I have this response with empty IPAddress : 我的响应是空IPAddress:

"NetworkSettings": { "Bridge": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "MacAddress": "", "PortMapping": null, "Ports": null },

How can I know/define this IP ? 我如何知道/定义此IP?

Thanks, 谢谢,

When using port mapping you're mapping a port on your host to redirect traffic to the port on the container. 使用端口映射时,您正在映射主机上的端口以将流量重定向到容器上的端口。 So in order to access your service running in a container that was executed with -p 80:80, You simply need to go to http://localhost:80/ 因此,为了访问在以-p 80:80执行的容器中运行的服务,您只需要转到http:// localhost:80 /

映像文件中是否暴露了端口80?

I'm the image's maintainer ;) 我是图片的维护者;)

Yes, the ports are exposed... and this image work well on my MacBook (with Kitematick)... 是的,端口是裸露的……并且此图像在我的MacBook(带有Kitematick)上运行良好……

The problem is I can't help him to launch my image on his Ubuntu since on my Apple, the container has an IP like 192.168.99.100... and I need to call it to have access to the webserver... 问题是我不能帮他在他的Ubuntu上启动我的映像,因为在我的Apple上,该容器的IP地址为192.168.99.100 ...并且我需要调用它才能访问Web服务器...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM