FROM alpine:3.24@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6

ARG TOFU_VERSION=1.11.0

RUN apk add --no-cache \
      ansible \
      bash \
      bind-tools \
      ca-certificates \
      curl \
      git \
      jq \
      openssh-client \
      openssl \
      python3 \
      py3-pip \
      sshpass \
      unzip

RUN curl -sfL -o /tmp/tofu.zip \
      "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_amd64.zip" \
 && echo "c425c2080e3f204a1fe094356777535a34c4bc9fdbca4eccb74cdd25c1ae8a94  /tmp/tofu.zip" | sha256sum -c - \
 && unzip -q /tmp/tofu.zip -d /tmp/tofu \
 && install /tmp/tofu/tofu /usr/local/bin/tofu \
 && rm -rf /tmp/tofu /tmp/tofu.zip

RUN pip3 install --break-system-packages --no-cache-dir \
      proxmoxer \
      requests

RUN ansible-galaxy collection install \
      community.proxmox \
      community.docker
