FROM mcr.microsoft.com/dotnet/runtime:9.0
RUN apt-get update && apt-get install -y --no-install-recommends curl unzip \
    && rm -rf /var/lib/apt/lists/*

# Install OpenTAP
RUN curl -Lo /tmp/opentap.zip \
      'https://packages.opentap.io/4.0/Objects/Packages/OpenTAP?os=Linux&architecture=x64' \
    && unzip /tmp/opentap.zip -d /opt/tap && rm /tmp/opentap.zip \
    && chmod +x /opt/tap/tap
ENV PATH="/opt/tap:${PATH}"

# Install plugins (pin versions for reproducibility)
# RUN tap package install "Demonstration" --version 9.x -y --non-interactive

# Add test plan + settings
COPY plans/ /opt/tap/plans/
COPY Settings/ /opt/tap/Settings/

WORKDIR /opt/tap
ENTRYPOINT ["tap", "run"]
CMD ["plans/MyPlan.TapPlan", "--non-interactive"]
