Returns Docker Compose-style container name with project name as prefix.
162504
protected function getContainerName($container) {
    $this->validateConfig();
    // Project name is defined in a nice, human-readable style, so lowercase it
    // first.
    $project_lowercase = strtolower($this->config->get('name'));
    // Replace all spaces to match the behavior of Docker Compose. Then finally
    // append container name.
    return str_replace(' ', '', $project_lowercase) . '_' . $container;
  }
1097811
function() {
    return {
      compose: app.composeCore,
      project: app.name,
      opts: {
        services: ['appserver'],
        app: app
      }
    };
  }
1060733
function getProjectName() {
      var pwd = grunt.file.read('pwd.md').trim().split('/')
      var projectName = pwd[pwd.length - 1]
      return projectName
    }
891084
def generate_docker_compose(self):
        
        example = {}
        example['app'] = {}
        example['app']['environment'] = []
        for key in sorted(list(self.spec.keys())):
            if self.spec[key]['type'] in (dict, list):
                value = f"\'{json.dumps(self.spec[key].get('example', ''))}\'"
            else:
                value = f"{self.spec[key].get('example', '')}"
            example['app']['environment'].append(f"{self.env_prefix}_{key.upper()}={value}")
        print(yaml.dump(example, default_flow_style=False))
861449
def generate_docker_targets():
    """"""
    output = {}
    for py_ver in python_versions.values():
        filepath = os.path.join(container_config_root, py_ver.docker_file)
        output[filepath] = generate_docker_file(py_ver)
        filepath = os.path.join(container_config_root, py_ver.compose_file)
        output[filepath] = generate_compose_file(py_ver)
    return output
984857
def flatten_container(self, container):
        
        for names in ARG_MAP.values():
            if names[TransformationTypes.CHRONOS.value]['name'] and \
                            '.' in names[TransformationTypes.CHRONOS.value]['name']:
                chronos_dotted_name = names[TransformationTypes.CHRONOS.value]['name']
                parts = chronos_dotted_name.split('.')

                if parts[-2] == 'parameters':
                    # Special lookup for docker parameters
                    common_type = names[TransformationTypes.CHRONOS.value].get('type')
                    result = self._lookup_parameter(container, parts[-1], common_type)
                    if result:
                        container[chronos_dotted_name] = result
                else:
                    result = lookup_nested_dict(container, *parts)
                    if result:
                        container[chronos_dotted_name] = result
        return container
548054
def get_container_version():
    """"""
    root_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
    version_file = os.path.join(root_dir, 'VERSION')
    if os.path.exists(version_file):
        with open(version_file) as f:
            return f.read()
    return ''
621789
function getProjectName () {
  const pkgJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), {encoding: 'utf8'}))
  return pkgJson.name
}
942796
def namespace(self):
        
        if self.prefix is None:
            return Namespace.default
        else:
            return self.resolvePrefix(self.prefix)
1064627
def containers_running(get_container_name):
    
    running = []
    for n in ['web', 'postgres', 'solr', 'datapusher', 'redis']:
        info = docker.inspect_container(get_container_name(n))
        if info and not info['State']['Running']:
            running.append(n + '(halted)')
        elif info:
            running.append(n)
    return running
1353092
def get_branch_container_tag(self):
        
        if self.__prefix:
            return "{0}-{1}".format(
                self.__prefix,
                self.__branch)
        else:
            return "{0}".format(self.__branch)
518205
def rm(name):
    
    path = get_existing_project_path(name)

    click.confirm(
        'Are you sure you want to delete project %s?' % name, abort=True)

    container_name = get_container_name(name)
    client = docker.Client()
    try:
        client.inspect_container(container_name)
    except docker.errors.NotFound:
        pass
    else:
        print("Removing container %s..." % container_name)
        client.remove_container(container_name, v=True, force=True)

    print("Removing %s..." % path)
    shutil.rmtree(path)
853740
def _get_container_path(container):
    '''
    
    '''
    root = os.path.join(__opts__['cachedir'], 'azurefs')
    container_dir = '{0}_{1}_{2}'.format(container.get('account_name', ''),
                                         container.get('container_name', ''),
                                         container.get('saltenv', 'base'))
    return os.path.join(root, container_dir)
784746
public static Container findContainerByIdOrByName( String name, DockerClient dockerClient ) {

		Container result = null;
		List<Container> containers = dockerClient.listContainersCmd().withShowAll( true ).exec();
		for( Container container : containers ) {
			List<String> names = Arrays.asList( container.getNames());

			// Docker containers are prefixed with '/'.
			// At least, those we created, since their parent is the Docker daemon.
			if( container.getId().equals( name )
					|| names.contains( "/" + name )) {
				result = container;
				break;
			}
		}

		return result;
	}
410572
def build_prefixes(namespaces=None):
    
    if namespaces is None:
        namespaces = [
            ('bf', str(BIBFRAME)),
            ('schema', str(SCHEMA_ORG))
        ]
    output = "PREFIX {}: <{}>\n".format(
        namespaces[0][0],
        namespaces[0][1])
    if len(namespaces) == 1:
        return output
    else:
        for namespace in namespaces[1:]:
            output += "PREFIX  {}: <{}>\n".format(namespace[0], namespace[1])
    return output
500469
def get_container_image_ids(self):
        

        statuses = graceful_chain_get(self.json, "status", "containerStatuses")
        if statuses is None:
            return {}

        def remove_prefix(image_id, prefix):
            if image_id.startswith(prefix):
                return image_id[len(prefix):]

            return image_id

        return {status['image']: remove_prefix(status['imageID'], 'docker://')
                for status in statuses}
1341925
def get_prefix(self):
        """"""
        prefix = self.bucket
        if self.prefix:
            prefix += self.delimiter + self.prefix
        return prefix