简体   繁体   中英

Use Docker with my Ubuntu 14.04 (web access)

I've installed Docker on Ubuntu 14.04 by using repositories. I have version 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.

When I type :

docker inspect 8f1526ff5287

I have this response with empty 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 ?

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/

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

I'm the image's maintainer ;)

Yes, the ports are exposed... and this image work well on my MacBook (with 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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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