Docker Community Forums

Share and learn in the Docker community.

Gradle task to create docker image


(Apanjiyar) #1

Hello everyone,
I just started using gradle and docker. I am try to create docker image using below task:
task buildDocker(type: Docker, dependsOn: build) {
baseImage = 'openjdk:8-jdk-alpine’
doFirst{
copy {
from jar
into "${stageDir}"
rename { ‘ap-test.jar’ }
}
}
entryPoint([“sh”, “-c”, “java -Djava.security.egd=file:/dev/./urandom -jar /ap-test.jar”])
exposePort(8080)
}

however while running the container i am getting error that /ap-test.jar can not be found. can anyone please help? i tried with the path ./ap-test.jar but still same issue.