Browse Source

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

zyx 5 năm trước cách đây
mục cha
commit
198afa72cd
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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...)