import org.elasticsearch.gradle.DockerBase apply plugin: 'base' tasks.register("buildDockerBuildContext", Tar) { archiveExtension = 'tar.gz' compression = Compression.GZIP archiveClassifier = "docker-build-context" archiveBaseName = "elasticsearch" // Non-local builds don't need to specify an architecture. with dockerBuildContext(null, false, DockerBase.CENTOS, false) } tasks.named("assemble").configure {dependsOn "buildDockerBuildContext"}