I have attempted to set up my own spring project with the same docker file and gradle file but I keep getting this.
I have pulled your project and it works I just don't seem to understand or even come close to why this isn't working? Can someone help?
"[docker build -t springio/gs-spring-boot-docker:latest C:\Users\mohamed.omar\workspaces\caseware cloud backup\build\docker] returned:
"docker build" requires exactly 1 argument(s).
See 'docker build --help'. "
`
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath('org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE')
// tag::build[]
classpath('se.transmode.gradle:gradle-docker:1.2')
// end::build[]
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
// tag::plugin[]
apply plugin: 'docker'
// end::plugin[]
// This is used as the docker image prefix (org)
group = 'springio'
jar {
baseName = 'gs-spring-boot-docker'
version = '0.1.0'
}
// tag::task[]
task buildDocker(type: Docker, dependsOn: build) {
applicationName = jar.baseName
dockerfile = file('Dockerfile')
doFirst {
copy {
from jar
into "${stageDir}/target"
}
}
}
// end::task[]
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
`
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD target/gs-spring-boot-docker-0.1.0.jar app.jar
ENV JAVA_OPTS=""
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
![image](https://user-images.githubusercontent.com/24386887/28882060-61522ae4-77aa-11e7-9894-57fe67bc147a.png)