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.

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

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配