com.bmuschko.gradle.docker.tasks.image.DockerLoadImage.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-plugin Show documentation
Show all versions of gradle-docker-plugin Show documentation
Gradle plugin for managing Docker images and containers.
package com.bmuschko.gradle.docker.tasks.image
import com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
import com.github.dockerjava.api.DockerClient
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.Input
class DockerLoadImage extends AbstractDockerRemoteApiTask {
@Input
final RegularFileProperty imageFile = newOutputFile()
@Override
void runRemoteCommand(DockerClient dockerClient) {
dockerClient.loadImageCmd(new FileInputStream(imageFile.get().asFile)).exec()
}
}