private void addVolumesFrom(Container container, BindMode mode) { volumesFroms.add(new VolumesFrom(container.getContainerName(), mode.accessMode)); }
/** * Parses a volume from specification to a {@link VolumesFrom}. * * @param serialized * the specification, e.g. <code>container:ro</code> * @return a {@link VolumesFrom} matching the specification * @throws IllegalArgumentException * if the specification cannot be parsed */ public static VolumesFrom parse(String serialized) { try { String[] parts = serialized.split(":"); switch (parts.length) { case 1: { return new VolumesFrom(parts[0]); } case 2: { return new VolumesFrom(parts[0], AccessMode.valueOf(parts[1])); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'"); } }
private void addVolumesFrom(Container container, BindMode mode) { volumesFroms.add(new VolumesFrom(container.getContainerName(), mode.accessMode)); }
/** * Parses a volume from specification to a {@link VolumesFrom}. * * @param serialized * the specification, e.g. <code>container:ro</code> * @return a {@link VolumesFrom} matching the specification * @throws IllegalArgumentException * if the specification cannot be parsed */ public static VolumesFrom parse(String serialized) { try { String[] parts = serialized.split(":"); switch (parts.length) { case 1: { return new VolumesFrom(parts[0]); } case 2: { return new VolumesFrom(parts[0], AccessMode.valueOf(parts[1])); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'"); } }
private VolumesFrom[] volumesFrom(Id id) { final List<com.alexecollins.docker.orchestration.model.VolumeFrom> volumes = conf(id).getVolumesFrom(); final VolumesFrom[] out = new VolumesFrom[volumes.size()]; for (int i = 0; i < volumes.size(); i++) { com.alexecollins.docker.orchestration.model.VolumeFrom volume = volumes.get(i); final Container container = findContainer(volume.getId()); if (container == null) { throw new OrchestrationException(String.format( "Can not use volume %s, unable to find corresponding container.", volume.getId())); } final AccessMode accessMode = AccessMode.fromBoolean(volume.isReadWrite()); out[i] = new VolumesFrom(volume.getId().toString(), accessMode); } return out; }
createContainerCmd.withVolumesFrom(new VolumesFrom(getContainerId()));
ArrayList<VolumesFrom> volFrom = new ArrayList<>(); for (String volFromStr : getVolumesFrom2()) { volFrom.add(new VolumesFrom(volFromStr));
createContainerCmd.withVolumesFrom(new VolumesFrom(getContainerId()));
createContainerCmd.withVolumesFrom(new VolumesFrom(dockerClient.getContainerId())); } else { String testFilesPath = KurentoTest.getTestFilesDiskPath();
createContainerCmd.withVolumesFrom(new VolumesFrom(dockerClient.getContainerId())); } else { String testFilesPath = KurentoTest.getTestFilesDiskPath();