feat: get container path relative to config dir
This commit is contained in:
parent
93a1b74e34
commit
78626c10af
@ -66,6 +66,10 @@ func Images() (diis []Image, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func ImagePath(sk config.KernelMask) string {
|
||||
return config.Dir("containers", sk.DistroType.String(), sk.DistroRelease)
|
||||
}
|
||||
|
||||
type Container struct {
|
||||
name string
|
||||
|
||||
|
@ -110,17 +110,6 @@ func MatchPackages(km config.KernelMask) (pkgs []string, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func dockerImagePath(sk config.KernelMask) (path string, err error) {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
path = usr.HomeDir + "/.out-of-tree/containers/"
|
||||
path += sk.DistroType.String() + "/" + sk.DistroRelease
|
||||
return
|
||||
}
|
||||
|
||||
func vsyscallAvailable() (available bool, err error) {
|
||||
if runtime.GOOS != "linux" {
|
||||
// Docker for non-Linux systems is not using the host
|
||||
@ -142,10 +131,7 @@ func vsyscallAvailable() (available bool, err error) {
|
||||
func GenerateBaseDockerImage(registry string, commands []config.DockerCommand,
|
||||
sk config.KernelMask, forceUpdate bool) (err error) {
|
||||
|
||||
imagePath, err := dockerImagePath(sk)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
imagePath := container.ImagePath(sk)
|
||||
dockerPath := imagePath + "/Dockerfile"
|
||||
|
||||
d := "# BASE\n"
|
||||
|
Loading…
Reference in New Issue
Block a user