diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 014aa2a80..0ec0b7170 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,4 +16,5 @@ ketangupta34 onkardahale Akshit Garg burnerlee -Praveen Kumar \ No newline at end of file +Praveen Kumar +Harsh Rao \ No newline at end of file diff --git a/docker-compose.sh b/docker-compose.sh index 9c075acf8..a1ca1cd0a 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -199,24 +199,37 @@ sub_cache() { $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.cache.yml build cli } -# Build MetaCall Docker Compose with multi-platform specifier (link manually dockerignore files) sub_platform() { - if [ -z "$METACALL_PLATFORM" ]; then - echo "Error: METACALL_PLATFORM variable not defined" - exit 1 - fi - - ln -sf tools/deps/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build deps - - ln -sf tools/dev/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build dev - - ln -sf tools/runtime/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build runtime - - ln -sf tools/cli/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build cli + # Default platform if not defined + if [ -z "$METACALL_PLATFORM" ]; then + METACALL_PLATFORM="linux/amd64" + echo "METACALL_PLATFORM not defined. Defaulting to: $METACALL_PLATFORM" + else + echo "Building for platform: $METACALL_PLATFORM" + fi + + # Set up Buildx if not already configured + docker buildx ls | grep multiarch_builder || docker buildx create --name multiarch_builder --use + docker buildx inspect multiarch_builder --bootstrap + + # Build dependencies + ln -sf tools/deps/.dockerignore .dockerignore + docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/deps . + + # Build development environment + ln -sf tools/dev/.dockerignore .dockerignore + docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/dev . + + # Build runtime for all platforms + ln -sf tools/runtime/.dockerignore .dockerignore + docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/runtime . + + # Build CLI for all platforms + ln -sf tools/cli/.dockerignore .dockerignore + docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/cli . + + echo "Build process complete for platform: $METACALL_PLATFORM" + } # Push MetaCall Docker Compose