NKM
NKM

Reputation: 664

AWS CodeBuild /codebuild/output/tmp/script.sh: docker: not found

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.

Upvotes: 3

Views: 13648

Answers (2)

NKM
NKM

Reputation: 664

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.

Upvotes: 2

Subin Mathew
Subin Mathew

Reputation: 2545

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.

Upvotes: 1

Related Questions