mirror of
https://github.com/linka-cloud/d2vm.git
synced 2026-01-24 02:25:04 +00:00
feat: add --hostname flag to customize the vm hostname
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -110,6 +110,7 @@ var (
|
||||
d2vm.WithKeepCache(keepCache),
|
||||
d2vm.WithPlatform(platform),
|
||||
d2vm.WithPull(false),
|
||||
d2vm.WithHostname(hostname),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ var (
|
||||
d2vm.WithKeepCache(keepCache),
|
||||
d2vm.WithPlatform(platform),
|
||||
d2vm.WithPull(pull),
|
||||
d2vm.WithHostname(hostname),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ var (
|
||||
|
||||
keepCache bool
|
||||
platform string
|
||||
|
||||
hostname string
|
||||
)
|
||||
|
||||
func validateFlags() error {
|
||||
@@ -116,5 +118,6 @@ func buildFlags() *pflag.FlagSet {
|
||||
flags.BoolVar(&keepCache, "keep-cache", false, "Keep the images after the build")
|
||||
flags.StringVar(&platform, "platform", d2vm.Arch, "Platform to use for the container disk image, linux/arm64 and linux/arm64 are supported")
|
||||
flags.BoolVar(&pull, "pull", false, "Always pull docker image")
|
||||
flags.StringVar(&hostname, "hostname", "localhost", "Hostname to set in the generated image")
|
||||
return flags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user