Add HOSTNAME env var to container
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
f6c2df62c9
commit
7e1e21f1f4
1 changed files with 2 additions and 0 deletions
|
@ -912,7 +912,9 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
||||||
specgen.AddBindMount("/etc/hosts", "/etc/hosts", options)
|
specgen.AddBindMount("/etc/hosts", "/etc/hosts", options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set hostname and add env for hostname
|
||||||
specgen.SetHostname(sb.Hostname())
|
specgen.SetHostname(sb.Hostname())
|
||||||
|
specgen.AddProcessEnv("HOSTNAME", sb.Hostname())
|
||||||
|
|
||||||
specgen.AddAnnotation(annotations.Name, containerName)
|
specgen.AddAnnotation(annotations.Name, containerName)
|
||||||
specgen.AddAnnotation(annotations.ContainerID, containerID)
|
specgen.AddAnnotation(annotations.ContainerID, containerID)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue