3
votes

I am using AWS CodeBuild to build my application. I am using example build spec file as given here: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-example I have already uploaded my custom Docker image to AWS ECR having requisites to build my application (Java/Scala based). I get following error:

Reading package lists...
 [Container] 2018/10/26 10:40:07 Running command echo Entered the install phase...
Entered the install phase...
 [Container] 2018/10/26 10:40:07 Running command docker login -u AWS -p
..... 
/codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: docker: not found

Why should I get this error ? AWS CodeBuild is supposed to download this Docker image from ECR and then follow the instructions that I provide in the build spec file for building my application.

2
Do you have Docker installed on the machine?Mornor
Which machine ? My understanding is that CodeBuild is going to provision the machine automatically before actually starting the build process. At least the example buildspec file didn't specify anything like installing docker, etc.NKM

2 Answers

2
votes

The example build.spec file assumes that your build image has Docker already installed. I was assuming "wrongly" that CodeBuild will install/configure Docker tools inside the image automatically.

1
votes

Issue looks similar to AWS CodeBuild - docker: not found. I can't paste the same response to this question. So, please check my response there on how to enable Docker inside your build container to see if that solves your issue.