Permission error when trying codebuild local, works in the cloud

0

Hi. When trying to run our codebuild project locally, which works fine in the aws service, I am getting the following permission denied errors..

$ docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=ae3d6c1b2d7a" -e "ARTIFACTS=/home/user/output" -e "SOURCE=/home/user/project" amazon/aws-codebuild-local:latest
Removing agent-resources_build_1 ... done
Removing agent-resources_agent_1 ... done
Removing network agent-resources_default
Removing volume agent-resources_source_volume
Removing volume agent-resources_user_volume
Creating network "agent-resources_default" with the default driver
Creating volume "agent-resources_source_volume" with local driver
Creating volume "agent-resources_user_volume" with local driver
Creating agent-resources_agent_1 ... done
Creating agent-resources_build_1 ... done
Attaching to agent-resources_agent_1, agent-resources_build_1
agent_1  | touch: cannot touch '/codebuild/output/log': Permission denied
agent_1  | tail: cannot open '/codebuild/output/log' for reading: No such file or directory
agent_1  | mkdir: cannot create directory '/codebuild/input/bin': Permission denied
agent-resources_agent_1 exited with code 1
Stopping agent-resources_build_1 ... done
Aborting on container exit...

Can anyone help me out here? It looks like the local codebuild service runs a couple of containers, one of which (the agent_1 container) should have a /codebuild/output/ directory which I suspect it does not, however I am not sure if this is supposed to be the mounted directory in my home directory it is having issues with or not.

Thanks
Matt.

已提問 5 年前檢視次數 633 次
3 個答案
0

Hi! Could you please tell us more about your environment (OS & Docker version)?

AWS
Zhen Li
已回答 5 年前
0

Sure, I am running linux, CentOS 7. Docker version 1.13.1, build 94f4240/1.13.1

What else do you need to know?

(do you prefer to keep the thread here or on the git issue?)

已回答 5 年前
0

Looks like selinux was the issue and needed to provide the correct permission for the container to run and use my hosts files.

Thanks for helping :)

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南