runfinch / finch

The Finch CLI an open source client for container development
https://www.runfinch.com
Apache License 2.0
3.46k stars 87 forks source link

Support AWS CodeBuild local builds with Finch #979

Open branrin opened 1 week ago

branrin commented 1 week ago

What is the problem you're trying to solve?. Currently AWS CodeBuild support Docker, but not Finch, as the build container.

Describe the feature you'd like Finch supported on AWS CodeBuild

austinvazquez commented 1 week ago

Hi @branrin, thanks for trying out Finch. Working to understand your use case better. Can you provide some details to help clarify?

Some initial questions I had:

  1. Is the gap for be able to run AWS CodeBuild local builds using Finch or for AWS CodeBuild to swap to Finch as a container runtime?
  2. If 2, as a AWS CodeBuild user, are they some advantages to using Finch that you are interested to gain?
branrin commented 1 week ago

Hi @austinvazquez

  1. I think the gap here is mostly being able to run AWS CodeBuild local builds using Finch
  2. We are looking to avoid having to pay for Docker licenses going forward and using Finch as the replacement
austinvazquez commented 1 week ago

Thanks for the additional details.

Initial triage

AWS CodeBuild provides a mechanism for testing builds locally using the CodeBuild local agent. See https://github.com/aws/aws-codebuild-docker-images/tree/020c2a44daa209a4fcab13d9eec8023616463498/local_builds.

This enables AWS CodeBuild users to simulate a environment locally to troubleshoot commands and settings in the BuildSpec file and build applications locally before committing changes to build in the cloud.

The CodeBuild local agent simulates the environment by running a Docker container with the Docker socket volume mounted for Container-in-container mode. (also sometimes referred to as Docker-in-Docker or DinD) See https://github.com/aws/aws-codebuild-docker-images/blob/020c2a44daa209a4fcab13d9eec8023616463498/local_builds/codebuild_build.sh#L100-L105

At this time, Finch does not support container in container mode. Further analysis is required to understand if this is a hard requirement for the AWS CodeBuild local agent or if local builds can be achieved via another method.