You need to enable JavaScript to run this app. Docker Compose的azure_file卷能否指定共享内子文件夹路径进行挂载?
优惠活动
大模型
产品
解决方案
定价
更多

Docker Compose的azure_file卷能否指定共享内子文件夹路径进行挂载?

要实现Azure文件共享指定子路径挂载,只需要在卷定义的driver_opts中新增remotepath参数,指定你要挂载的子目录在共享内的相对路径即可。

修改后的完整配置

loadbalancer:
    image: haproxytech/haproxy-ubuntu:2.5
    ...
    volumes:
      - haproxy:/usr/local/etc/haproxy

volumes:
  haproxy:
    driver: azure_file
    driver_opts:
      share_name: acishare
      storage_account_name: tctstorage2
      storage_account_key: <account_key>
      remotepath: haproxy/enduser # 新增此行指定子路径

注意事项

  • remotepath参数取值为目标子目录在acishare共享内的相对路径,不需要额外加共享名前缀
  • 你指定的子路径必须已经在Azure文件共享中提前创建完成,否则会出现挂载失败问题
  • 若后续需要挂载同共享下的其他子路径(如haproxy/promoter),只需单独定义新的卷,修改对应remotepath的取值即可

内容的提问来源于stack exchange,提问作者Samantha Létourneau

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.08 13:06:04