- Newest
- Most votes
- Most comments
I am unsure of the answer, but it looks like you are using Docker in CodeBuild and cannot connect Docker Damon.
Is PrivilegedMode enabled in CodeBuild? Maybe enabling it will improve the situation.
If you read my post, then you'll see that the mentioned exception is raised during the integration tests execution by Maven. So, it doesn't have anything to do with the
docker runcommand as the execution stops before it. However, thesam local start-apicommand runs probably a Docker image. But since, as explained in my post, the mentioned script works as expected when run locally, it is supposed to run exactly the same way when run by CodeBuild. I think that you'll agree with me that a script, whatever it is, doesn't have to be modified in order to be run by CodeBuild. If it was the case, then CodeBuild wouldn't be usable. Anyway, to come back to thesam local start-apicommand and considering that it may execute a Docker image under the hood, there is no reason to try to modify the way that this image might by run and, above all, no reason to enablePriviledgedMode. Furthermore, there is no such an option enabling the DockerPriviledgedModein thesam local start-apicommand. Perhaps, there is simply no running Docker daemon on the EC2 instance that CodeBuild spins up in order to run the build.I didn't find anything in the CodeBuild documentation talking about what processes are installed and running on these instances that CodeBuild is spinning up. But thank you anyway for your concern.Hello, nicolas! Please give me more time if you still need to solve the problem.
Well, there is indeed an error before
docker run. What I noticed is the following message.Timed out while attempting to establish a connection to the container.
The message indicates that communication to the container has timed out.
You are right that there is no clear reason to enable PrivilegedMode. However, it is worth a try.
PrivilegedMode is not a SAM option, it is a CodeBuild setting, and in the CloudFormation template it is an Envelopment property.
For an example of how to write it, please refer to the following. https://docs.aws.amazon.com/codebuild/latest/userguide/build-caching.html
Relevant content
- AWS OFFICIALUpdated 3 months ago

Anyone there ?