aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-20 11:07:35 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-21 17:24:49 +0000
commit5c3e4cfa62452b9cd5c2c08bf081ab524ded1cb4 (patch)
treed259c5a6c689141a43fd4f9249b4aa7697d4e320 /libpod/container_internal.go
parent946b4ced544e5988a971da12c7e34a684ab0e39d (diff)
downloadpodman-5c3e4cfa62452b9cd5c2c08bf081ab524ded1cb4.tar.gz
podman-5c3e4cfa62452b9cd5c2c08bf081ab524ded1cb4.tar.bz2
podman-5c3e4cfa62452b9cd5c2c08bf081ab524ded1cb4.zip
Override hostname for container
Adds the ability to override the container's hostname. Also, uses the first twelve characters of the container ID as the default hostname if none is provided. Signed-off-by: baude <bbaude@redhat.com> Closes: #248 Approved by: baude
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index c052f61fe..9b785bfa5 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -508,3 +508,8 @@ func (c *Container) generateHosts() (string, error) {
}
return c.WriteStringToRundir("hosts", hosts)
}
+
+// generateEtcHostname creates a containers /etc/hostname
+func (c *Container) generateEtcHostname(hostname string) (string, error) {
+ return c.WriteStringToRundir("hostname", hostname)
+}