Skip to content

Commit

Permalink
Pass hostname to toolbox container.
Browse files Browse the repository at this point in the history
  • Loading branch information
likan999 committed Oct 4, 2020
1 parent 03c6989 commit 792eea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ func createContainer(container, image, release string, showCommandToEnter bool)
panic("release not specified")
}

hostname, err := os.Hostname()
if err != nil {
return err
}

enterCommand := getEnterCommand(container, release)

logrus.Debugf("Checking if container %s already exists", container)
Expand Down Expand Up @@ -334,7 +339,7 @@ func createContainer(container, image, release string, showCommandToEnter bool)
"create",
"--dns", "none",
"--env", toolboxPathEnvArg,
"--hostname", "toolbox",
"--hostname", hostname,
"--ipc", "host",
"--label", "com.github.containers.toolbox=true",
"--label", "com.github.debarshiray.toolbox=true",
Expand Down
2 changes: 1 addition & 1 deletion toolbox
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ create()
$podman_command create \
--dns none \
--env TOOLBOX_PATH="$TOOLBOX_PATH" \
--hostname toolbox \
--hostname "$(hostname)" \
--ipc host \
--label "com.github.containers.toolbox=true" \
--label "com.github.debarshiray.toolbox=true" \
Expand Down

0 comments on commit 792eea1

Please sign in to comment.