Skip to content

Instantly share code, notes, and snippets.

@janoulle
Last active May 5, 2018 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janoulle/00e085d7eef6a73f3e22c8cf9049b4ac to your computer and use it in GitHub Desktop.
Save janoulle/00e085d7eef6a73f3e22c8cf9049b4ac to your computer and use it in GitHub Desktop.
//generates image like this: $project.group/applicationName:tagVersion
task image(type: Docker, dependsOn: build ) {
project.group = '' //this prevents the generated image from having the group value added. Personal preference to do this
applicationName = "yourapp"
dockerfile = file('Dockerfile')
tagVersion = 'latest'
doFirst {
copy {
from jar
into "${stageDir}/target"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment