Support to use a non-default bridge network when running CodeBuild locally
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.
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.
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
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.