Command resource cleanup after command execution by tedoc2000 · Pull Request #120 · docker-java/docker-java
Navigation Menu
{{ message }}
docker-java / docker-java Public
- Notifications You must be signed in to change notification settings
- Fork 1.1k
Merged
marcuslinke merged 1 commit intodocker-java:masterfrom
Jan 7, 2015Merged
Command resource cleanup after command execution#120
marcuslinke merged 1 commit intodocker-java:masterfrom
Command resource cleanup after command execution#120
marcuslinke merged 1 commit intodocker-java:masterfrom
Conversation
Copy link
Contributor
tedoc2000
commented
Jan 6, 2015
tedoc2000
commented
It seems important to be able to do this.. Let me know if you want this to be the default.
Copy link
Contributor
marcuslinke
commented
Jan 7, 2015
marcuslinke commented
Jan 7, 2015@tedoc2000 Thanks for the hint and your contribution first. But maybe we should introduce a more generic concept of a resource cleanup after command execution instead? Something like close() that is called on the command object right after command execution. WDYT?
Copy link
Contributor Author
tedoc2000
commented
Jan 7, 2015
tedoc2000 commented
Jan 7, 2015Sounds good.. Let me redo this pull request.
DockerCmd<T> now extends java.io.Closeable. This allows us to cleanup the
temporary tar file created when DockerClient.buildImageCmd(File)
is invoked.
Code would look like:
BuildImageCmd cmd = dockerClient.buildCmd(myDir);
try {
// ..
// cmd.exec();
// ...
} finally {
cmd.close();
}
tedoc2000
force-pushed
the
master
branch
from
e57b7fa to
f0e78bd
Compare
Copy link
Contributor Author
tedoc2000
commented
Jan 7, 2015
tedoc2000 commented
Jan 7, 2015Okay updated..
marcuslinke
merged commit
f0e78bd
into
docker-java:master
Copy link
Contributor
marcuslinke
commented
Jan 7, 2015
marcuslinke commented
Jan 7, 2015@tedoc2000 Thanks for your effort!
marcuslinke
changed the title
Add support for deleting temporary temp tar files
Command resource cleanup after command execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment