3

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? Commented Oct 26, 2018 at 11:11
  • 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. Commented Oct 26, 2018 at 11:27

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

1 Comment

I got it clarified from AWS support. I had assumed "wrongly" that the image that I am using has Docker built-in. I added commands to install Docker in my build image and now I am able to use it successfully. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.