createCommand.withLinks(allLinks.toArray(new Link[allLinks.size()]));
allLinkedContainerNetworks.addAll(linkedContainerNetworks); createCommand.withLinks(allLinks.toArray(new Link[allLinks.size()])); allLinkedContainerNetworks.remove("bridge"); if (allLinkedContainerNetworks.size() > 1) {
private CreateContainerCmd getBaseCommand() { String hostDir = MesosCluster.getClusterHostDir().getAbsolutePath(); List<Bind> binds = new ArrayList<>(); binds.add(Bind.parse("/var/run/docker.sock:/var/run/docker.sock:rw")); binds.add(Bind.parse("/sys/fs/cgroup:/sys/fs/cgroup")); binds.add(Bind.parse(hostDir + ":" + hostDir)); if (getCluster().getMapAgentSandboxVolume()) { binds.add(Bind.parse(String.format("%s:%s:rw", hostDir + "/.minimesos/sandbox-" + getClusterId() + "/" + hostName, MESOS_AGENT_WORK_DIR + hostName + "/slaves"))); } CreateContainerCmd cmd = DockerClientFactory.build().createContainerCmd(getImageName() + ":" + getImageTag()) .withName(getName()) .withHostName(hostName) .withPrivileged(true) .withVolumes(new Volume(MESOS_AGENT_WORK_DIR + hostName)) .withEnv(newEnvironment() .withValues(getMesosAgentEnvVars()) .withValues(getSharedEnvVars()) .createEnvironment()) .withPidMode("host") .withLinks(new Link(getZooKeeper().getContainerId(), "minimesos-zookeeper")) .withBinds(binds.stream().toArray(Bind[]::new)); MesosDns mesosDns = getCluster().getMesosDns(); if (mesosDns != null) { cmd.withDns(mesosDns.getIpAddress()); } return cmd; }
cfgCmd.withName(containerNameRes); HostConfig hc = new HostConfig(); cfgCmd.withLinks(LinkUtils.parseLinks(linksRes).getLinks()); if (envVarsRes != null) { cfgCmd.withEnv(envVarsRes);
createContainerCmd.withLinks(toLinks(containerConfiguration.getLinks()));
createContainerCmd.withLinks(toLinks(containerConfiguration.getLinks()));