Back to Home

Overview

The https://github.com/palantir/gradle-docker plugin

plugins {
    id 'com.palantir.docker' version '<version>'
}

Tags and Metadata

docker {
    name 'hub.docker.com/username/my-app:version'
    tags 'latest' // deprecated, use 'tag'
    tag 'myRegistry', 'my.registry.com/username/my-app:version'
    dockerfile file('Dockerfile')
    files tasks.distTar.outputs, 'file1.txt', 'file2.txt'
    buildArgs([BUILD_VERSION: 'version'])
    labels(['key': 'value'])
    pull true
    noCache true
}

Docker Push

docker.name = 'mycompany/myname'

docker {
    tags project.version, 'latest'
    /* ... other items omitted for brevity ... */
}

tasks.dockerPush.dependsOn { tasks.dockerTag }

dockerPush {
    dependsOn { tasks.dockerTag }
}

Docker Pull

Docker Run and Wait

 
gradle_docker.txt · Last modified: 2019/12/16 00:31 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd