resolve symlinks while making dockerfile path absolute
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
cf89fd1aa1
commit
45bd60c33a
@ -420,8 +420,15 @@ func dockerFilePath(ctxName string, dockerfile string) string {
|
||||
if dockerfile == "" {
|
||||
return ""
|
||||
}
|
||||
if urlutil.IsGitURL(ctxName) || filepath.IsAbs(dockerfile) {
|
||||
if urlutil.IsGitURL(ctxName) {
|
||||
return dockerfile
|
||||
}
|
||||
return filepath.Join(ctxName, dockerfile)
|
||||
if !filepath.IsAbs(dockerfile) {
|
||||
dockerfile = filepath.Join(ctxName, dockerfile)
|
||||
}
|
||||
symlinks, err := filepath.EvalSymlinks(dockerfile)
|
||||
if err == nil {
|
||||
return symlinks
|
||||
}
|
||||
return dockerfile
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user