diff --git a/container-compose b/container-compose index c827b51..e8be566 100755 --- a/container-compose +++ b/container-compose @@ -131,14 +131,19 @@ build(){ platform=$(yq e ".services.$service.platform" "$file") image=$(yq e ".services.$service.image" "$file") + build=$(yq e ".services.$service.build" "$file") context=$(yq e ".services.$service.build.context" "$file") dockerfile=$(yq e ".services.$service.build.dockerfile" "$file") # Replace '/' and ':' with '-' in the platform string to make it suitable for a tag platform_tag=$(echo "$platform" | tr '/:' '-') # Append platform information to the image tag new_image_tag="${image}-${platform_tag}" - - $engine buildx build --platform $platform -t $new_image_tag -f $context/$dockerfile $context + + # If dockerfile is null or empty, set it to "Dockerfile" + if [ -z "$dockerfile" ]; then + dockerfile="Dockerfile" + fi + $engine buildx build --platform $platform -t $new_image_tag -f $context$dockerfile $context done } #push(){