Skip to content

Commit

Permalink
adding create/startContainer tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-gupta committed Feb 11, 2017
1 parent 8b43a9a commit 73c225d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.bmuschko.docker-java-application'

import com.bmuschko.gradle.docker.tasks.container.*
import com.bmuschko.gradle.docker.tasks.image.*

sourceCompatibility = 1.8
targetCompatibility = 1.8

Expand All @@ -29,4 +32,14 @@ docker {
baseImage = 'openjdk:latest'
tag = 'hellojava'
}
}
}

task createContainer(type: DockerCreateContainer) {
dependsOn dockerBuildImage
targetImageId { dockerBuildImage.getImageId() }
}

task startContainer(type: DockerStartContainer) {
dependsOn createContainer
targetContainerId { createContainer.getContainerId() }
}

0 comments on commit 73c225d

Please sign in to comment.