Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
Experimental support for custom docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
kdvolder committed Sep 28, 2020
1 parent b0a0ae1 commit 1a258e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@

public class DockerApp extends AbstractDisposable implements App, ChildBearing, Deletable, ProjectRelatable, DesiredInstanceCount, SystemPropertySupport, LogSource, DevtoolsConnectable {



private static final String DOCKER_IO_LIBRARY = "docker.io/library/";
private static final String[] NO_STRINGS = new String[0];
private DockerClient client;
Expand Down Expand Up @@ -144,7 +146,7 @@ public String getName() {
public List<App> fetchChildren() throws Exception {
Builder<App> builder = ImmutableList.builder();
if (client!=null) {
List<Image> images = JobUtil.interruptAfter(Duration.ofSeconds(200),
List<Image> images = JobUtil.interruptAfter(Duration.ofSeconds(15),
() -> client.listImagesCmd().withShowAll(true).exec()
);
synchronized (this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ public List<App> fetchChildren() throws Exception {
List<Container> containers = JobUtil.interruptAfter(Duration.ofSeconds(15),
() -> client.listContainersCmd()
.withShowAll(true)
.withAncestorFilter(ImmutableList.of(image.getId()))
.withLabelFilter(ImmutableMap.of(DockerApp.APP_NAME, app.getName()))
.exec()
);
//TODO: use 'ancestor' filter instead of this for loop to filter on image id
for (Container container : containers) {
if (container.getImageId().equals(image.getId())) {
builder.add(new DockerContainer(getTarget(), app, container));
}
builder.add(new DockerContainer(getTarget(), app, container));
}
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public ImageDescriptor getCustomRunStateIcon() {
}
}
return builder.build();
} catch (TimeoutException e) {
//ignore, expected error
// } catch (TimeoutException e) {
// //ignore, expected error
} catch (Exception e) {
Log.log(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<classpathentry exported="true" kind="lib" path="dependency/commons-lang-2.6.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-api-3.2.5.jar" sourcepath="/home/kdvolder/.m2/repository/com/github/docker-java/docker-java-api/3.2.5/docker-java-api-3.2.5-sources.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-core-3.2.5.jar" sourcepath="/home/kdvolder/.m2/repository/com/github/docker-java/docker-java-core/3.2.5/docker-java-core-3.2.5-sources.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-transport-3.2.5.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-transport-zerodep-3.2.5.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-transport-3.2.5.jar" sourcepath="/home/kdvolder/.m2/repository/com/github/docker-java/docker-java-transport/3.2.5/docker-java-transport-3.2.5-sources.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/docker-java-transport-zerodep-3.2.5.jar" sourcepath="/home/kdvolder/.m2/repository/com/github/docker-java/docker-java-transport-zerodep/3.2.5/docker-java-transport-zerodep-3.2.5-sources.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/guava-19.0.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/jackson-annotations-2.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="dependency/jackson-core-2.11.2.jar"/>
Expand Down

0 comments on commit 1a258e0

Please sign in to comment.