def hostname(self, hostname):
        """ hostname setter

        """
        if not isinstance(hostname, six.string_types):
            raise TypeError("hostname must be a string.  {0} was passed.".format(type(hostname)))

        # if a host name is passed and its not valid raise else set hostname empty strings are the docker default.
        if hostname and not is_valid_hostname(hostname):
            raise ValueError("{0} isn't a valid hostname").format(hostname)
        else:
            self._hostname = hostname