I was trying to build docker image using aws code build service and then push it to ECR. Commands which i used for it in "buildspec.yml"
is specified in below.
version: 0.2
phases:
install:
runtime-versions:
docker: 18
pre_build:
- $(aws ecr get-login --no-include-email --region us-east-1)
- REPOSITORY_URI=XXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/devopswebbuild
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
build:
commands:
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
But i am getting error during build process, docker command is unable to connect to docker daemon.Please help me to solve these issue.
Docker build project configuration details is given below:
Build error details is given below: