【问题标题】:How to make docker container be notified when volume from another container was updated?更新另一个容器的卷时如何通知 docker 容器?
【发布时间】:2017-01-27 13:08:58
【问题描述】:

我只有带有 Nginx 的 docker 容器和带有静态(JS、CSS)文件的数据容器。 在应用程序启动时,Nginx 使用 volume_from 从数据容器挂载卷。 当我想更新我的静态文件时出现问题,因为 Nginx 容器无法看到该卷已更改。 是否可以在不重启 Nginx 容器的情况下获取静态卷更改?

proxy:
  image: proxy
  volumes_from:
    - static:ro
  ports:
    - "80:80"
  restart: always
  sequential_deployment: true
static:
  image: static
  volumes:
    - /home/node/static/build
  read_only: true
  command: "true"

【问题讨论】:

    标签: docker deployment docker-compose docker-cloud data-containers


    【解决方案1】:

    我从 VirtualBox 知道这个问题。你可以尝试将它添加到你的 nginx.conf 中:

    sendfile off;
    

    Nginx Docs

    【讨论】:

      猜你喜欢
      • 2019-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-21
      • 2023-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多