mirror of https://github.com/docker/compose.git
Fix edge-case bug path prefix check for watch & bind mounts
Signed-off-by: Matiboux <matiboux@gmail.com>
This commit is contained in:
parent
f38f3f754c
commit
9129abe516
|
|
@ -353,8 +353,11 @@ func loadDevelopmentConfig(service types.ServiceConfig, project *types.Project)
|
|||
|
||||
func checkIfPathAlreadyBindMounted(watchPath string, volumes []types.ServiceVolumeConfig) bool {
|
||||
for _, volume := range volumes {
|
||||
if volume.Bind != nil && strings.HasPrefix(watchPath, volume.Source) {
|
||||
return true
|
||||
if volume.Bind != nil {
|
||||
relPath, err := filepath.Rel(volume.Source, watchPath)
|
||||
if err == nil && !strings.HasPrefix(relPath, "..") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -37,4 +37,7 @@ services:
|
|||
RUN mkdir -p /app/config
|
||||
init: true
|
||||
command: sleep infinity
|
||||
volumes:
|
||||
- ./dat:/app/dat
|
||||
- ./data-logs:/app/data-logs
|
||||
develop: *x-dev
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
i am a wannabe cat
|
||||
|
|
@ -0,0 +1 @@
|
|||
[INFO] Server started successfully on port 8080
|
||||
Loading…
Reference in New Issue