Skip to content

Commit 200abab

Browse files
buck-rossnievesmontero
authored andcommitted
doc: cover new toolbox create --hostname flag
Updated the `toolbox create` manual page to cover the usage of the new `--hostname` flag for specifying custom hostnames when creating new containers. Signed-off-by: Buckley Ross <[email protected]> Change-Id: I16d7f63769c17aec1ff69d34ac8fe28f48827777
1 parent bcc6205 commit 200abab

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/toolbox-create.1.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ toolbox\-create - Create a new toolbox container
66
## SYNOPSIS
77
**toolbox create** [*--authfile AUTHFILE*]
88
[*--distro DISTRO* | *-d DISTRO*]
9+
[*--hostname HOSTNAME*]
910
[*--image NAME* | *-i NAME*]
1011
[*--release RELEASE* | *-r RELEASE*]
1112
[*CONTAINER*]
@@ -95,6 +96,11 @@ Create a toolbox container for a different operating system DISTRO than the
9596
host. Cannot be used with `--image`. Has to be coupled with `--release` unless
9697
the selected DISTRO matches the host.
9798

99+
**--hostname** HOSTNAME
100+
101+
Initializes the netowork hostname of the toolbox container to the specified value.
102+
If not specified, this will default to **toolbox**.
103+
98104
**--image** NAME, **-i** NAME
99105

100106
Change the NAME of the image used to create the toolbox container. This is

src/cmd/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func init() {
123123
func create(cmd *cobra.Command, args []string) error {
124124
// This regex filters out strings which are not valid hostnames, according to RFC-1123.
125125
// Source: https://stackoverflow.com/a/106223
126-
var hostnameRegexp = regexp.MustCompile("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])$")
126+
var hostnameRegexp = regexp.MustCompile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])$`)
127127

128128
if utils.IsInsideContainer() {
129129
if !utils.IsInsideToolboxContainer() {

0 commit comments

Comments
 (0)