FROM golang:1.24-bookworm AS builder
WORKDIR /build

# Install build dependencies
RUN apt-get update && apt-get install -y build-essential zlib1g-dev git

# Copy go.mod and go.sum first for dependency caching
COPY go.mod go.sum ./


# Copy the test program (can be either test_abfss_duckdb.go or test_abfss_duckdb_sqlx.go)
COPY scripts/s3ops/test_abfss_duckdb_sqlx.go /build/test_abfss_duckdb.go

# Build the binary - use simpler flags to avoid compiler issues
RUN CGO_ENABLED=1 go build -o test_abfss_duckdb test_abfss_duckdb.go

# Keep the binary in the builder stage for easier extraction

