def _run_web_container(self, port, command, address, log_syslog=False,<EOL>datapusher=True, interactive=False):
if is_boot2docker():<EOL><INDENT>ro = {}<EOL>volumes_from = self._get_container_name('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>ro = {self.datadir + '<STR_LIT>': '<STR_LIT>'}<EOL>volumes_from = None<EOL><DEDENT>links = {<EOL>self._get_container_name('<STR_LIT>'): '<STR_LIT>',<EOL>self._get_container_name('<STR_LIT>'): '<STR_LIT>'<EOL>}<EOL>links.update({self._get_container_name(container): container<EOL>for container in self.extra_containers})<EOL>if datapusher:<EOL><INDENT>if '<STR_LIT>' not in self.containers_running():<EOL><INDENT>raise DatacatsError(container_logs(self._get_container_name('<STR_LIT>'), "<STR_LIT:all>",<EOL>False, False))<EOL><DEDENT>links[self._get_container_name('<STR_LIT>')] = '<STR_LIT>'<EOL><DEDENT>ro = dict({<EOL>self.target: '<STR_LIT>',<EOL>scripts.get_script_path('<STR_LIT>'): '<STR_LIT>',<EOL>scripts.get_script_path('<STR_LIT>'): '<STR_LIT>'},<EOL>**ro)<EOL>rw = {<EOL>self.sitedir + '<STR_LIT>': '<STR_LIT>',<EOL>self.sitedir + '<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>try:<EOL><INDENT>if not interactive:<EOL><INDENT>run_container(<EOL>name=self._get_container_name('<STR_LIT>'),<EOL>image='<STR_LIT>',<EOL>rw=rw,<EOL>ro=ro,<EOL>links=links,<EOL>volumes_from=volumes_from,<EOL>command=command,<EOL>port_bindings={<EOL><NUM_LIT>: port if is_boot2docker() else (address, port)},<EOL>log_syslog=log_syslog<EOL>)<EOL><DEDENT>else:<EOL><INDENT>if is_boot2docker():<EOL><INDENT>switches = ['<STR_LIT>',<EOL>self._get_container_name('<STR_LIT>'), '<STR_LIT>',<EOL>self._get_container_name('<STR_LIT>')]<EOL><DEDENT>else:<EOL><INDENT>switches = []<EOL><DEDENT>switches += ['<STR_LIT>'.format(vol, ro[vol]) for vol in ro]<EOL>switches += ['<STR_LIT>'.format(vol, rw[vol]) for vol in rw]<EOL>links = ['<STR_LIT>'.format(link, links[link]) for link in links]<EOL>args = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', self._get_container_name('<STR_LIT>'),<EOL>'<STR_LIT>', '<STR_LIT>'.format(port) if is_boot2docker()<EOL>else '<STR_LIT>'.format(address, port)] +switches + links + ['<STR_LIT>', ] + command<EOL>subprocess.call(args)<EOL><DEDENT><DEDENT>except APIError as e:<EOL><INDENT>if '<STR_LIT>' in str(e):<EOL><INDENT>raise DatacatsError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>
Start web container on port with command