问题原文
原帖链接 · Sreeraju V · CC BY-SA 4.0
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:
已采纳解答
原帖链接 · Sreeraju V · CC BY-SA 4.0
I am answering my own question, so it may help some one who is getting same issue. Solution was pretty straightforward, i need to check the privilaged tab which i didn't notice.
Solution :
- From the AWS CodeBuild Console, select the Build Project.
- Select the 'Edit' dropdown from the top-right corner, and select the 'Environment' option.
- Within the 'Edit Environment' page, select 'Override image'. After this, scroll down to find the 'Privileged' option and select it.
- Select 'Update Environment' to ensure that the property is updated.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
