mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
Do not resolve mount linux abs path as windows path on windows (eg. /var/run/docker.sock => c:/var/run/docker.sock folder)
Signed-off-by: guillaume.tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
003d61f6c6
commit
7a25378590
@ -774,7 +774,9 @@ func isUnixAbs(path string) bool {
|
|||||||
|
|
||||||
func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.Mount, error) {
|
func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.Mount, error) {
|
||||||
source := volume.Source
|
source := volume.Source
|
||||||
if volume.Type == types.VolumeTypeBind && !filepath.IsAbs(source) {
|
// on windows, filepath.IsAbs(source) is false for unix style abs path like /var/run/docker.sock.
|
||||||
|
// do not replace these with filepath.Abs(source) that will include a default drive.
|
||||||
|
if volume.Type == types.VolumeTypeBind && !filepath.IsAbs(source) && !strings.HasPrefix(source, "/") {
|
||||||
// volume source has already been prefixed with workdir if required, by compose-go project loader
|
// volume source has already been prefixed with workdir if required, by compose-go project loader
|
||||||
var err error
|
var err error
|
||||||
source, err = filepath.Abs(source)
|
source, err = filepath.Abs(source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user