mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
expose unresolved path for volumes and resolve symlink in container.getResourcePath
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
This commit is contained in:
parent
def86d0cf4
commit
65d4047cb6
2 changed files with 7 additions and 3 deletions
|
@ -139,7 +139,11 @@ func (container *Container) WriteHostConfig() (err error) {
|
|||
|
||||
func (container *Container) getResourcePath(path string) string {
|
||||
cleanPath := filepath.Join("/", path)
|
||||
return filepath.Join(container.basefs, cleanPath)
|
||||
result, err := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, cleanPath), container.basefs)
|
||||
if err != nil {
|
||||
utils.Errorf("getResourcePath failed: %v", err)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (container *Container) getRootResourcePath(path string) string {
|
||||
|
|
|
@ -280,8 +280,8 @@ func initializeVolume(container *Container, volPath string, binds map[string]Bin
|
|||
delete(container.VolumesRW, volPath)
|
||||
}
|
||||
|
||||
container.Volumes[newVolPath] = destination
|
||||
container.VolumesRW[newVolPath] = srcRW
|
||||
container.Volumes[volPath] = destination
|
||||
container.VolumesRW[volPath] = srcRW
|
||||
|
||||
if err := createIfNotExists(source, volIsDir); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue