Docker path not known.
CodeMasterMo opened this issue · 3 comments
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" ]
You must change the "group" setting to your own docker hub group.
That wasn't the problem @gregturn
facepalm the problem is that my project folder had spaces in them. See the path with spaces in them: I thought gradle would atleast be able to handle this much when it comes to spaces in between folder names to put it between quotes or something.
docker build -t springio/gs-spring-boot-docker:latest
C:\Users\mohamed.omar\workspaces\caseware cloud backup\build\docker
This is an issue that is already known that gradle doesn't like spaces so by this I will close this issue. Thank you!