Skip to content

Commit

Permalink
cmd/create: Use container name as container hostname
Browse files Browse the repository at this point in the history
..to distinguish different toolboxes more easily inside a toolbox,
this includes version information too (by default).
Replace underscores with dashes since underscores are not allowed in hostnames.

Fixes: #98, #120
Signed-off-by: Ievgen Popovych <[email protected]>
  • Loading branch information
Jmennius committed May 24, 2022
1 parent 4469774 commit 3593746
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func createContainer(container, image, release string, showCommandToEnter bool)
createArgs = append(createArgs, xdgRuntimeDirEnv...)

createArgs = append(createArgs, []string{
"--hostname", "toolbox",
"--hostname", strings.NewReplacer("_", "-", ".", "-").Replace(container),
"--ipc", "host",
"--label", "com.github.containers.toolbox=true",
}...)
Expand Down

0 comments on commit 3593746

Please sign in to comment.