Skip to content

Commit c0af553

Browse files
committed
Option to run docker prune before jobs
1 parent 44aa8ba commit c0af553

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/run/DockerWrapper.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class DockerWrapper extends AbstractCommandWrapper
2121
private final PipelineContext _ctx;
2222
private File _tmpDir = null;
2323
private String _entryPoint = null;
24+
private boolean _runPrune = true;
2425

2526
public DockerWrapper(String containerName, Logger log, PipelineContext ctx)
2627
{
@@ -41,6 +42,11 @@ public void setEntryPoint(String entryPoint)
4142
_entryPoint = entryPoint;
4243
}
4344

45+
public void setRunPrune(boolean runPrune)
46+
{
47+
_runPrune = runPrune;
48+
}
49+
4450
public void executeWithDocker(List<String> containerArgs, File workDir, PipelineOutputTracker tracker) throws PipelineJobException
4551
{
4652
File localBashScript = new File(workDir, "docker.sh");
@@ -56,6 +62,11 @@ public void executeWithDocker(List<String> containerArgs, File workDir, Pipeline
5662
writer.println("WD=`pwd`");
5763

5864
writer.println("DOCKER='" + SequencePipelineService.get().getDockerCommand() + "'");
65+
if (_runPrune)
66+
{
67+
writer.println("$DOCKER image prune -f");
68+
}
69+
5970
writer.println("$DOCKER pull " + _containerName);
6071
writer.println("$DOCKER run --rm=true \\");
6172

0 commit comments

Comments
 (0)