doudui6756 2015-01-10 11:49
浏览 251
已采纳

Docker,清漆,连接由同行重置

I'm just trying to set up a web server using Docker. I have 3 different containers:

  • jprjr/php-fpm

    sudo docker run --name c_php-fpm -v $HOME/data/webstack/www:/srv/http:ro -p 9000:9000 -d jprjr/php-fpm

  • nginx

    sudo docker run --name c_nginx -v $HOME/data/webstack/www:/usr/share/nginx/html:ro -p 8080:80 --link c_php-fpm:c_php-fpm -d nginx nginx

  • jacksoncage/varnish

    sudo docker run --name c_varnish -i -d -p 80:80 --link c_nginx:c_nginx -e VARNISH_BACKEND_PORT=80 -e VARNISH_BACKEND_IP=c_nginx jacksoncage/varnish

PHP and nginx are working without any problem but there is an error for varnish:

curl -I http://localhost/index.html curl: (56) Recv failure: Connection reset by peer

sudo docker ps return:

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4ee21c4a80e2 jacksoncage/varnish:latest "/bin/bash" 25 minutes ago Up 25 minutes 0.0.0.0:80->80/tcp c_varnish
4dcc7babd92c nginx:latest "nginx" 16 hours ago Up 48 minutes 443/tcp, 0.0.0.0:8080->80/tcp c_nginx
3c0f8c1d634c jprjr/php-fpm:latest "php-fpm -F" 16 hours ago Up 48 minutes 0.0.0.0:9000->9000/tcp c_php-fpm

sudo docker logs c_varnish return nothing.

Thanks !

  • 写回答

1条回答 默认 最新

  • dqwcdqs358367 2015-01-10 17:04
    关注

    There is a bug in the current image of the container related with Varnish VCL files no longer accepting environment variables in the backend config: https://github.com/jacksoncage/varnish-docker/issues/2

    To solve it, get the original Dockerfile and associated files from https://github.com/jacksoncage/varnish-docker, apply the patch in https://github.com/jacksoncage/varnish-docker/pull/3/commits and rebuild the image with

    sudo docker build -t jacksoncage/varnish .
    

    You should be able to run new containers with the generated image working correctly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料