# Dockerfile for Bazel integration testing
# Provides Bazel + C++ toolchain without needing local installation

FROM gcr.io/bazel-public/bazel:7.0.0

# Switch to root to install packages
USER root

# Install additional tools
RUN apt-get update && apt-get install -y \
    build-essential \
    netcat-openbsd \
    bc \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /workspace

# Copy Bazel workspace files
COPY WORKSPACE BUILD.bazel .bazelrc .gitignore ./
COPY *.py *.cc *.h ./
COPY test_integration.sh test_integration_s3.sh test_integration_auth.sh ./

# Make test scripts executable
RUN chmod +x test_integration.sh test_integration_s3.sh test_integration_auth.sh

# Default command runs the integration test
CMD ["./test_integration.sh"]
