Closed andig closed 3 years ago
Update: looks as if the problem is the command chaining:
if name == t.Name() {
tmpl = t
} else {
tmpl = t.New(name)
}
will create a template of ci.Dockerfile
name, not tmpl.Dockerfile
as one might expect due to
parse, err := template.New("tmpl.Dockerfile").
Funcs(sprig.FuncMap()).
ParseFiles(dockerfileTemplate)
if err != nil {
return err
}
Imho this does not work as expected
One potential workaround could be to use template.Parse
instead of template.ParseFiles
here as this will keep the template name unchanged. I'm not sure if that will handle hierarchical templates though.
Fixed by 3f28a201b4402c19d2ad9d898da4fd9a61ccdd4e
I needed to have a separate template file and copied
tmpl.Dockerfile
toci.Dockerfile
. Running with different name fails:This seems to happen inside
parse.Execute
becauset.Tree
is nil but I couldn't figure out why. The produced architecture dockerfile turns up empty.