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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ImagePath(sk config.KernelMask) string {
|
||||||
|
return config.Dir("containers", sk.DistroType.String(), sk.DistroRelease)
|
||||||
|
}
|
||||||
|
|
||||||
type Container struct {
|
type Container struct {
|
||||||
name string
|
name string
|
||||||
|
|
||||||
|
@ -110,17 +110,6 @@ func MatchPackages(km config.KernelMask) (pkgs []string, err error) {
|
|||||||
return
|
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) {
|
func vsyscallAvailable() (available bool, err error) {
|
||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
// Docker for non-Linux systems is not using the host
|
// 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,
|
func GenerateBaseDockerImage(registry string, commands []config.DockerCommand,
|
||||||
sk config.KernelMask, forceUpdate bool) (err error) {
|
sk config.KernelMask, forceUpdate bool) (err error) {
|
||||||
|
|
||||||
imagePath, err := dockerImagePath(sk)
|
imagePath := container.ImagePath(sk)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dockerPath := imagePath + "/Dockerfile"
|
dockerPath := imagePath + "/Dockerfile"
|
||||||
|
|
||||||
d := "# BASE\n"
|
d := "# BASE\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user