mirror of
https://github.com/docker/compose.git
synced 2025-07-06 13:24:25 +02:00
check secret source exists, as bind mount would create target as a folder otherwise
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
ce27dba52e
commit
34b18194f7
@ -1003,11 +1003,18 @@ func buildContainerSecretMounts(p types.Project, s types.ServiceConfig) ([]mount
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(definedSecret.File); os.IsNotExist(err) {
|
||||||
|
logrus.Warnf("secret file %s does not exist", definedSecret.Name)
|
||||||
|
}
|
||||||
|
|
||||||
mnt, err := buildMount(p, types.ServiceVolumeConfig{
|
mnt, err := buildMount(p, types.ServiceVolumeConfig{
|
||||||
Type: types.VolumeTypeBind,
|
Type: types.VolumeTypeBind,
|
||||||
Source: definedSecret.File,
|
Source: definedSecret.File,
|
||||||
Target: target,
|
Target: target,
|
||||||
ReadOnly: true,
|
ReadOnly: true,
|
||||||
|
Bind: &types.ServiceVolumeBind{
|
||||||
|
CreateHostPath: false,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user