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.

gefragt vor 5 Jahren638 Aufrufe
3 Antworten
0

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

AWS
Zhen Li
beantwortet vor 5 Jahren
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?)

beantwortet vor 5 Jahren
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 :)

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen