@Override public void up() throws IOException, InterruptedException { for (int currRetryAttempt = 0; currRetryAttempt <= retryAttempts; currRetryAttempt++) { try { getDockerCompose().up(); return; } catch (DockerExecutionException e) { Set<String> conflictingContainerNames = getConflictingContainerNames(e.getMessage()); if (conflictingContainerNames.isEmpty()) { // failed due to reason other than conflicting containers, so re-throw throw e; } log.debug("docker-compose up failed due to container name conflicts (container names: {}). " + "Removing containers and attempting docker-compose up again (attempt {}).", conflictingContainerNames, currRetryAttempt + 1); removeContainers(conflictingContainerNames); } } throw new DockerExecutionException("docker-compose up failed"); }
@Override public void up() throws IOException, InterruptedException { for (int currRetryAttempt = 0; currRetryAttempt <= retryAttempts; currRetryAttempt++) { try { getDockerCompose().up(); return; } catch (DockerExecutionException e) { Set<String> conflictingContainerNames = getConflictingContainerNames(e.getMessage()); if (conflictingContainerNames.isEmpty()) { // failed due to reason other than conflicting containers, so re-throw throw e; } log.debug("docker-compose up failed due to container name conflicts (container names: {}). " + "Removing containers and attempting docker-compose up again (attempt {}).", conflictingContainerNames, currRetryAttempt + 1); removeContainers(conflictingContainerNames); } } throw new DockerExecutionException("docker-compose up failed"); }
@Override public void up() throws IOException, InterruptedException { for (int currRetryAttempt = 0; currRetryAttempt <= retryAttempts; currRetryAttempt++) { try { getDockerCompose().up(); return; } catch (DockerExecutionException e) { Set<String> conflictingContainerNames = getConflictingContainerNames(e.getMessage()); if (conflictingContainerNames.isEmpty()) { // failed due to reason other than conflicting containers, so re-throw throw e; } log.debug("docker-compose up failed due to container name conflicts (container names: {}). " + "Removing containers and attempting docker-compose up again (attempt {}).", conflictingContainerNames, currRetryAttempt + 1); removeContainers(conflictingContainerNames); } } throw new DockerExecutionException("docker-compose up failed"); }