From 9ac81982e245b2b6ba3fc9d564b49917bbcd4f9e Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Mon, 6 May 2019 08:26:10 +0200 Subject: [PATCH] [Enhancement] set hostnames for nodes --- cli/container.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/container.go b/cli/container.go index a17148161..bf48d7970 100644 --- a/cli/container.go +++ b/cli/container.go @@ -101,8 +101,9 @@ func createServer(verbose bool, image string, port string, args []string, env [] } config := &container.Config{ - Image: image, - Cmd: append([]string{"server"}, args...), + Hostname: containerName, + Image: image, + Cmd: append([]string{"server"}, args...), ExposedPorts: nat.PortSet{ containerPort: struct{}{}, }, @@ -150,9 +151,10 @@ func createWorker(verbose bool, image string, args []string, env []string, name } config := &container.Config{ - Image: image, - Env: env, - Labels: containerLabels, + Hostname: containerName, + Image: image, + Env: env, + Labels: containerLabels, } id, err := startContainer(verbose, config, hostConfig, networkingConfig, containerName)