title: Unable to Build Docker Image for Spring Boot No such property: parentFile
body: <p>I am trying to build a sample docker image for my helloworld program</p>
  <pre><code>import com.bmuschko.gradle.docker.tasks.image.Dockerfile
  import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
  
  plugins {
      id 'com.bmuschko.docker-remote-api' version '6.7.0'
      id 'org.springframework.boot' version '2.7.2'
      id 'io.spring.dependency-management' version '1.0.12.RELEASE'
      id 'java'
  }
  
  group = 'com.example'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '1.8'
  
  configurations {
      compileOnly {
          extendsFrom annotationProcessor
      }
  }
  
  repositories {
      mavenLocal()
      mavenCentral()
  }
  
  dependencies {
      implementation 'org.springframework.boot:spring-boot-starter-web'
      compileOnly 'org.projectlombok:lombok'
      annotationProcessor 'org.projectlombok:lombok'
      testImplementation 'org.springframework.boot:spring-boot-starter-test'
  }
  
  task createDockerfile(type: Dockerfile) {
      destFile = project.file('build/docker/Dockerfile')
      from 'openjdk:8-jre-alpine'
      copyFile &quot;libs/${jar.archiveBaseName}-${jar.archiveVersion}.jar&quot;, &quot;${jar.archiveBaseName}.jar&quot;
      entryPoint 'java'
      defaultCommand '-jar', &quot;${jar.archiveBaseName}.jar&quot;
      exposePort 8080
  }
  
  
  task buildImage(type: DockerBuildImage) {
      dependsOn createDockerfile
      inputDir = createDockerfile.destFile.parentFile
      tag = &quot;${jar.archiveBaseName}:latest&quot;
  }
  </code></pre>
  <p>Its giving me this error</p>
  <pre><code>Caused by: groovy.lang.MissingPropertyException: No such property: parentFile for class: org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultRegularFileVar
      at build_dawchkdhtqfn2zzdavoge0cnm$_run_closure5.doCall(/Users/mchavak/Downloads/demo/build.gradle:45)
      at org.gradle.util.internal.ClosureBackedAction.execute(ClosureBackedAction.java:73)
      at org.gradle.util.internal.ConfigureUtil.configureTarget(ConfigureUtil.java:155)
      at org.gradle.util.internal.ConfigureUtil.configureSelf(ConfigureUtil.java:131)
      at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:666)
      at org.gradle.api.DefaultTask.configure(DefaultTask.java:309)
      at org.gradle.api.internal.project.DefaultProject.task(DefaultProject.java:1294)
      at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:484)
      at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
      at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
      at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:34)
      at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:135)
      at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163)
      at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:84)
      at build_dawchkdhtqfn2zzdavoge0cnm.run(/Users/mchavak/Downloads/demo/build.gradle:43)
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
  </code></pre>