英文:
Go imageproxy inaccessible from docker container
问题
我正在尝试将优秀的Go图像代理服务器https://github.com/willnorris/imageproxy部署在Mac OSX上,作为Docker容器通过Docker Cloud进行部署。
我无法使容器对我的浏览器可访问。
docker run -i -t -p 8080:8080 willnorris/imageproxy:latest /go/bin/imageproxy -addr 0.0.0.0:8080
应该将服务器暴露在docker-machine ip [vmname]
,在这种情况下是192.168.56.100。
我通过以相同的方式运行一个原始的Express服务器来验证了我的设置。
有人知道这个服务的Docker化有什么问题吗?https://hub.docker.com/r/willnorris/imageproxy/
英文:
I am trying to deploy the excellent Go image proxy server https://github.com/willnorris/imageproxy on Mac OSX as docker container via Docker Cloud.
I cannot make the container accessible to my browser
docker run -i -t -p 8080:8080 willnorris/imageproxy:latest /go/bin/imageproxy -addr 0.0.0.0:8080
should expose the server at docker-machine ip [vmname]
, in this case 192.168.56.100
I verified my setup by running a vanilla Express server in the same way.
Would anyone know what is up with the dockerization of this service? https://hub.docker.com/r/willnorris/imageproxy/
答案1
得分: 1
从noogen https://github.com/willnorris/imageproxy/issues/57
能够使用'willnorris/imageproxy'版本重现此问题。我可以在容器内部使用curl访问端口8080,但无法从主机访问。
默认配置绑定到127.0.0.1(应该是0.0.0.0),因为这行代码:imageproxy(版本HEAD)监听在localhost:8080
imageproxy docker容器中的localhost(cat /etc/hosts)映射到127.0.0.1
将Dockerfile的第8行更改为:
ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:8080"]
英文:
From noogen https://github.com/willnorris/imageproxy/issues/57
Was able to reproduce this with the 'willnorris/imageproxy' version. I can curl port 8080 inside of the container but not from the host.
The default configuration binds to 127.0.0.1 (should be 0.0.0.0) because of this line: imageproxy (version HEAD) listening on localhost:8080
localhost in the imageproxy docker container (cat /etc/hosts) is map to 127.0.0.1
Change the Dockerfile line 8 to:
ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:8080"]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论