Skip to content

Commit

Permalink
fix: add proper FQDN to toolbox containers
Browse files Browse the repository at this point in the history
  • Loading branch information
akdev1l committed Dec 5, 2022
1 parent 9e1cc2a commit fa6ce2e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,20 @@ func createContainer(container, image, release string, showCommandToEnter bool)

createArgs = append(createArgs, xdgRuntimeDirEnv...)

hostname, err := os.Hostname()
containerHostname := ""
if err == nil {
containerHostname = "toolbox" + "." + hostname
logrus.Debugf("using container hostname: %s", containerHostname)
} else {
logrus.Warnf("could not get hostname, failed to deduce container hostname defaulting to plain 'toolbox'")
containerHostname = "toolbox"
}
createArgs = append(createArgs, []string{
"--hostname", containerHostname,
}...)

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

0 comments on commit fa6ce2e

Please sign in to comment.