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.

asked 4 years ago113 views
3 Answers
0

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

answered 4 years ago
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?)

answered 4 years ago
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 :)

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions