2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

centos-stream-9: fix Dockerfile template

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2024-07-09 18:32:19 +02:00
parent f711f8919d
commit e31bc93074
6 changed files with 26 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ import (
_ "embed"
"fmt"
"io"
"strconv"
"text/template"
"github.com/sirupsen/logrus"
@@ -36,10 +37,10 @@ var alpineDockerfile string
var centOSDockerfile string
var (
ubuntuDockerfileTemplate = template.Must(template.New("ubuntu.Dockerfile").Parse(ubuntuDockerfile))
debianDockerfileTemplate = template.Must(template.New("debian.Dockerfile").Parse(debianDockerfile))
alpineDockerfileTemplate = template.Must(template.New("alpine.Dockerfile").Parse(alpineDockerfile))
centOSDockerfileTemplate = template.Must(template.New("centos.Dockerfile").Parse(centOSDockerfile))
ubuntuDockerfileTemplate = template.Must(template.New("ubuntu.Dockerfile").Funcs(tplFuncs).Parse(ubuntuDockerfile))
debianDockerfileTemplate = template.Must(template.New("debian.Dockerfile").Funcs(tplFuncs).Parse(debianDockerfile))
alpineDockerfileTemplate = template.Must(template.New("alpine.Dockerfile").Funcs(tplFuncs).Parse(alpineDockerfile))
centOSDockerfileTemplate = template.Must(template.New("centos.Dockerfile").Funcs(tplFuncs).Parse(centOSDockerfile))
)
type NetworkManager string
@@ -117,3 +118,7 @@ func NewDockerfile(release OSRelease, img, password string, networkManager Netwo
}
return d, nil
}
var tplFuncs = template.FuncMap{
"atoi": strconv.Atoi,
}