-
-
Notifications
You must be signed in to change notification settings - Fork 55
Images API
Mihai edited this page Apr 19, 2020
·
7 revisions
final Docker docker = ...;
final Images images = docker.images();
- Pull an Image
- Import an Image
- Import Images from Tar File
- Delete (prune) Unused Images
- Filter Images
- Get Parent Docker
This will pull an image, from the Registry, to the Docker Engine.
final Image helloWorld = images.pull("hello-world", "latest");
This will import an Image, from the given URL and Repo, to the Docker Engine
final Image imported = images.import(
new URL("http://example.com/exampleimage.tgz"),
"hello-world"
);
This call will upload the read images to the Docker engine and return all of them (pre-existing and imported) back.
final Images fromTar = images.importFromTar("/path/images.tar");
This call will delete all the unused images from the Docker Engine.
images.prune();
You can filter them by providing a Map
of filters as explained in the API Guide:
final Images filtered = images.filter(...);
Get the Docker
instance to which the Images
belong:
final Docker parent = images.docker();