title: No value has been specified for property 'imageId' while creating container
body: <p>I am new to docker and using bmuschko plugin in gradle to create docker image, container and run it. Only buildImage task seems to work. When creating a container it says </p>
  
  <blockquote>
    <p>No value has been specified for property 'imageId'</p>
  </blockquote>
  
  <p>Here is my gradle file snippet.</p>
  
  <pre><code>dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
          classpath 'com.bmuschko:gradle-docker-plugin:2.6.5'
      }
  import com.bmuschko.gradle.docker.tasks.container.*
  import com.bmuschko.gradle.docker.tasks.image.*
  
  task copyJar(type: Copy) {
      dependsOn   'jar'
      from        'build/libs/rest-app-0.0.1-SNAPSHOT.jar'
      into        'build/docker'
  
      from        'src/main/resources/Dockerfile'
      into        'build/docker'
  }
  
  task buildImage(type: DockerBuildImage) {
      dependsOn 'copyJar'
      inputDir = file('build/docker');
      url = 'unix:///var/run/docker.sock'
      tag = 'rest-app/nci:0.1'
  }
  
  task createContainer(type: DockerCreateContainer) {
      dependsOn buildImage
      containerName = 'my-rest-app'
      targetImageId { buildImage.getImageId() }
      portBindings = ['8080:8080']
  }
  
  task startContainer(type: DockerStartContainer) {
      dependsOn createContainer
      targetContainerId { createContainer.getContainerId()}
  }
  
  build.dependsOn copyJar
  build.dependsOn buildImage
  build.dependsOn createContainer
  </code></pre>
  
  <p>Here is the stacktrace snippet.</p>
  
  <blockquote>
    <p>.....
    rest-app:check :rest-app:createContainer ID !!!!!!!8cf8fc8d2af9
    :rest-app:createContainer FAILED</p>
    
    <p>FAILURE: Build failed with an exception.</p>
    
    <p>What went wrong: A problem was found with the configuration of task
    ':rest-app:createContainer'.</p>
    
    <p>No value has been specified for property 'imageId'. Try: Run with
    --info or --debug option to get more log output.</p>
    
    <p>Exception is: org.gradle.api.tasks.TaskValidationException: A problem
    was found with the configuration of task ':rest-app:createContainer'.
    at
    org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:55)</p>
  </blockquote>
  
  <p>Can anyone please let me know how to solve this? Thanks in advance.</p>