aws-codebuild-docker-images icon indicating copy to clipboard operation
aws-codebuild-docker-images copied to clipboard

Support to use a non-default bridge network when running CodeBuild locally

Open bbideep opened this issue 3 years ago • 3 comments

Would it be possible to allow using a different bridge network and volumes instead of the default ones?

This can help using CodeBuild with other local dev tools like localstack where both can connect to a network independent of each other.

bbideep avatar Jul 21 '22 03:07 bbideep

In principal this should be pretty simple AFAICT ... all the codebuild_build.sh script does is build and execute a Docker command.

Having a crack at this now adding an argument to pass a --network among the other arguments.

My use case is wanting to test a job that has to talk to some account-local resources so the container is connected to our VPC network, for which I'll simulate the local resource in a named docker network and drop the codebuild container into it.

awilkins avatar Mar 03 '25 10:03 awilkins

Of course this is more complicated than it looks, what was I thinking .... the docker command starts the codebuild local agent and THAT starts the codebuild image

awilkins avatar Mar 03 '25 10:03 awilkins

Did a writeup of the cheesy way to do this in the linked ticket above. Also speculation on a non-cheesy way to do it.

TLDR : you can connect your simulated infrastructure to the default network that the local CodeBuild agent will use, or rewrite the compose file in the agent container to raise your infra stack as well and change the agent image the script uses.

BUT it would still be nice to have a way to inject this into the agent as with other things.

awilkins avatar Mar 05 '25 11:03 awilkins