浏览代码

bug fix: rsync can access the exclude file in Docker (close #59)

zyx 5 年之前
父节点
当前提交
198afa72cd
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      worker/docker.go

+ 4 - 0
worker/docker.go

@@ -19,6 +19,10 @@ func newDockerHook(p mirrorProvider, gCfg dockerConfig, mCfg mirrorConfig) *dock
 	volumes := []string{}
 	volumes = append(volumes, gCfg.Volumes...)
 	volumes = append(volumes, mCfg.DockerVolumes...)
+	if len(mCfg.ExcludeFile) > 0 {
+		arg := fmt.Sprintf("%s:%s:ro", mCfg.ExcludeFile, mCfg.ExcludeFile)
+		volumes = append(volumes, arg)
+	}
 
 	options := []string{}
 	options = append(options, gCfg.Options...)