diff --git a/Dockerfile.debian b/Dockerfile.debian new file mode 100644 index 0000000..1ef7b34 --- /dev/null +++ b/Dockerfile.debian @@ -0,0 +1,12 @@ +# Mostly intended for debugging full provisioning runs. +from debian:bookworm + +run echo 'deb http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/backports.list +run apt update -y && apt install -y ca-certificates gnupg2 systemd +run apt install -y -t bookworm-backports golang-1.20-go + +copy . /root/fup/ +workdir /root/fup +run /usr/lib/go-1.20/bin/go install + +cmd ["/bin/systemd"] diff --git a/Dockerfile.fedora b/Dockerfile.fedora index ed9f42d..a05e8dd 100644 --- a/Dockerfile.fedora +++ b/Dockerfile.fedora @@ -1,7 +1,7 @@ # Mostly intended for debugging full provisioning runs. from fedora:39 -run dnf update -y && dnf install -y gnupg2 golang systemd +run dnf update -y && dnf install -y ca-certificates gnupg2 golang systemd copy . /root/fup/ workdir /root/fup diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 23f2ddd..03bbfa2 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -1,7 +1,7 @@ # Mostly intended for debugging full provisioning runs. from ubuntu:mantic -run apt update -y && apt install -y gnupg2 golang systemd +run apt update -y && apt install -y ca-certificates gnupg2 golang systemd copy . /root/fup/ workdir /root/fup diff --git a/precheck/fact.go b/precheck/fact.go index 5da870a..93cfce9 100644 --- a/precheck/fact.go +++ b/precheck/fact.go @@ -121,7 +121,7 @@ func isOs(osId string) (bool, error) { return foundOsId == osId, nil } -func isOsVersion(version int) (bool, error) { +func isOsVersion(version float64) (bool, error) { osVersion, err := GetOSVersion() if err != nil { return false, err diff --git a/precheck/os.go b/precheck/os.go index bfb0bcc..fc1f258 100644 --- a/precheck/os.go +++ b/precheck/os.go @@ -69,16 +69,16 @@ func GetOSId() (string, error) { return getOSReleaseField(osIdField) } -func GetOSVersion() (int, error) { +func GetOSVersion() (float64, error) { versionStr, err := getOSReleaseField(osVersionField) if err != nil { return 0, err } - version, err := strconv.ParseInt(versionStr, 10, 64) + version, err := strconv.ParseFloat(versionStr, 64) if err != nil { return 0, err } - return int(version), nil + return version, nil }