Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use FQDN with toolbox prefix #1086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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