direct file is now also suppored

This commit is contained in:
Christian Goll
2022-04-14 14:45:23 +02:00
parent 18e2147953
commit ca698182f9
3 changed files with 13 additions and 2 deletions

View File

@@ -99,7 +99,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Printf(wwlog.ERROR, "VNFS Name exists, specify --force, --update, or choose a different name: %s\n", name)
os.Exit(1)
}
} else if strings.HasPrefix(uri, "docker://") || strings.HasPrefix(uri, "docker-daemon://") || strings.HasPrefix(uri, "file://") {
} else if strings.HasPrefix(uri, "docker://") || strings.HasPrefix(uri, "docker-daemon://") ||
strings.HasPrefix(uri, "file://") || util.IsFile(uri) {
sCtx, err := getSystemContext()
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)

View File

@@ -8,7 +8,13 @@ var (
Use: "import [OPTIONS] SOURCE [NAME]",
Short: "Import a container into Warewulf",
Long: `This command will pull and import a container into Warewulf from SOURCE,
optionally renaming it to NAME. The SOURCE must be in a supported URI format.
optionally renaming it to NAME. The SOURCE must be in a supported URI format. Formats
are:
* docker://registry.example.org/example:latest
* docker-daemon://example:latest
* file://path/to/archive/tar/ball
* /path/to/archive/tar/ball
* /path/to/chroot/
Imported containers are used to create bootable VNFS images.`,
Example: "wwctl container import docker://warewulf/centos-8 my_container",
RunE: CobraRunE,