title: aws code-build fails on build step
body: <p>Hi I runned the aws code pipeline on aws since months now. Since monday I got this error:</p>
  
  <pre><code>[Container] 2017/11/16 14:46:37 Running command chmod +x buildspec_prebuild.sh &amp;&amp; ./buildspec_prebuild.sh
  Flag --email has been deprecated, will be removed in 1.13.
  Login Succeeded
  {
  "failures": [
  {
  "failureReason": "Requested image not found", 
  "failureCode": "ImageNotFound", 
  "imageId": {
  "imageTag": "approval-machine-processes"
  }
  }
  ], 
  "imageIds": []
  }
  
  [Container] 2017/11/16 14:46:40 Phase complete: PRE_BUILD Success: true
  [Container] 2017/11/16 14:46:40 Phase context status code: Message: 
  [Container] 2017/11/16 14:46:40 Entering phase BUILD
  [Container] 2017/11/16 14:46:40 Running command echo "*** BUILD:"
  *** BUILD:
  
  [Container] 2017/11/16 14:46:40 Running command chmod +x buildspec_build.sh &amp;&amp; ./buildspec_build.sh
  /usr/share/sbt/bin/sbt-launch-lib.bash: line 207: bc: command not found
  </code></pre>
  
  <p>What could be the problem in this case?</p>
  
  <p>my build files look like this:</p>
  
  <p>buildspec_build.sh</p>
  
  <pre><code>#!/bin/bash
  
  # make code ready for docker
  sbt docker:stage
  cd target/docker/stage
  
  # add port for aws to dockerfile
  echo "EXPOSE 9000" &gt;&gt; Dockerfile
  
  # generate docker image tag
  docker build -t "$(cat /tmp/build_tag.out)" .
  </code></pre>
  
  <p>Has aws something changed?
  thanks in advance</p>
  
  <p>UPDATE: </p>
  
  <p>Here more messages:</p>
  
  <pre><code>./buildspec_build.sh: line 5: cd: target/docker/stage: No such file or directory
  Sending build context to Docker daemon 194.6 kB
  
  Step 1 : EXPOSE 9000
  Please provide a source image with `from` prior to commit
  
  [Container] 2017/11/16 15:23:13 Command did not exit successfully chmod +x buildspec_build.sh &amp;&amp; ./buildspec_build.sh exit status 1
  [Container] 2017/11/16 15:23:13 Phase complete: BUILD Success: false
  [Container] 2017/11/16 15:23:13 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: chmod +x buildspec_build.sh &amp;&amp; ./buildspec_build.sh. Reason: exit status 1
  [Container] 2017/11/16 15:23:13 Entering phase POST_BUILD
  [Container] 2017/11/16 15:23:13 Running command echo "*** POST-BUILD:"
  *** POST-BUILD:
  
  [Container] 2017/11/16 15:23:13 Running command chmod +x buildspec_postbuild.sh &amp;&amp; ./buildspec_postbuild.sh
  The push refers to a repository [.dkr.ecr.eu-central-1.amazonaws.com/......]
  An image does not exist locally with the tag:
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>buildspec.yml</p>
  
  <pre><code>version: 0.1
  phases:
    install:
      commands:
        - echo "*** INSTALL:"
        - chmod +x buildspec_install.sh &amp;&amp; ./buildspec_install.sh
    pre_build:
      commands:
        - echo "*** PRE-BUILD:"
        - chmod +x buildspec_prebuild.sh &amp;&amp; ./buildspec_prebuild.sh
    build:
      commands:
        - echo "*** BUILD:"
        - chmod +x buildspec_build.sh &amp;&amp; ./buildspec_build.sh
    post_build:
      commands:
        - echo "*** POST-BUILD:"
        - chmod +x buildspec_postbuild.sh &amp;&amp; ./buildspec_postbuild.sh
  </code></pre>
  
  <p>buildspec_install.sh</p>
  
  <pre><code>#!/bin/bash
  apt-get update
  
  # install jdk
  apt-get -y install software-properties-common
  apt-get -y install -y python-software-properties debconf-utils
  add-apt-repository -y ppa:openjdk-r/ppa
  apt-get update
  apt-get -y install openjdk-8-jdk
  update-alternatives --config java
  update-alternatives --config javac
  echo "java installation ok"
  
  # install sbt
  apt-get update
  apt-get -y install apt-transport-https
  echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
  apt-get update
  apt-get -y install sbt
  echo "sbt installation ok"
  
  pip install --upgrade awscli
  </code></pre>
  
  <p>buildspec_prebuild.sh</p>
  
  <pre><code>#!/bin/bash
  printf "%s:%s" "$REPOSITORY_URI" "$IMAGE_TAG" &gt; /tmp/build_tag.out
  $(aws ecr get-login)
  
  # delete old docker image
  aws ecr batch-delete-image --repository-name $REPOSITORY_NAME --image-ids imageTag=$IMAGE_TAG
  
  echo "old docker images"
  </code></pre>