code: func (container *Container) CreateDaemonEnvironment(tty bool, linkedEnv []string) []string {
  	// Setup environment
  	os := container.OS
  	if os == "" {
  		os = runtime.GOOS
  	}
  	env := []string{}
  	if runtime.GOOS != "windows" || (runtime.GOOS == "windows" && os == "linux") {
  		env = []string{
  			"PATH=" + system.DefaultPathEnv(os),
  			"HOSTNAME=" + container.Config.Hostname,
  		}
  		if tty {
  			env = append(env, "TERM=xterm")
  		}
  		env = append(env, linkedEnv...)
  	}
  
  	// because the env on the container can override certain default values
  	// we need to replace the 'env' keys where they match and append anything
  	// else.
  	env = ReplaceOrAppendEnvValues(env, container.Config.Env)
  	return env
  }
docs: // CreateDaemonEnvironment creates a new environment variable slice for this container.