Docker Community Forums

Share and learn in the Docker community.

Aws code-build fails on build step image is missing

docker
aws

(Holzfelix) #1

Hi I’m running the aws code pipeline since months now.

Now I got an error:

./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 && ./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 && ./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 && ./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:

My build file looks like this:

#!/bin/bash

# make code ready for docker
sbt docker:stage
cd target/docker/stage

# add port for aws to dockerfile
echo "EXPOSE 9000" >> Dockerfile

# generate docker image tag
docker build -t "$(cat /tmp/build_tag.out)" .

It seems like sbt docker:stage does not work

What is my fail? Has aws changed something?

Thanks in advance