mirror of https://github.com/docker/compose.git
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
|
||||
}
|
||||
|
||||
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{
|
||||
Type: types.VolumeTypeBind,
|
||||
Source: definedSecret.File,
|
||||
Target: target,
|
||||
ReadOnly: true,
|
||||
Bind: &types.ServiceVolumeBind{
|
||||
CreateHostPath: false,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue