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年前630ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ