buildscript { ext { springBootVersion = '1.4.4.RELEASE' } repositories { maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } mavenCentral() jcenter() } dependencies { classpath('se.transmode.gradle:gradle-docker:1.2') } } //apply plugin: 'docker' apply plugin: se.transmode.gradle.plugins.docker.DockerPlugin // 这里产生的镜像的标签会和 project。group一样,暂未找到解决办法 // tag = "${project.group}/${applicationName}:${tagVersion}" task buildDocker(type:Docker, dependsOn: build) { push = true // applicationName = jar.baseName tag = "10.10.100.200:5000/${jar.baseName}" dockerfile = file('src/main/docker/Dockerfile') doFirst { copy { from jar into stageDir } } } docker { hostUrl 'https://192.168.99.100:2376' // set the URL used to contact the Docker server. Defaults to http://localhost:2375 dockerBinary 'C:\\Program Files\\Docker Toolbox\\docker.exe' useApi false // Use the Docker Remote API instead of a locally installed docker binary. maintainer 'yingp@usoftchina.com'// The name and email address of the image maintainer. registry '10.10.100.200:5000' // The hostname and port of the Docker image registry unless the Docker Hub Registry is used. }