FROM alpine:3.21

ARG TALOS_VERSION=v1.12.6
ARG VELERO_VERSION=v1.16.0

RUN apk add --no-cache \
      aws-cli \
      bash \
      bind-tools \
      ca-certificates \
      curl \
      git \
      openssh-client \
      openssl \
      sops

RUN curl -sfL -o /usr/local/bin/talosctl \
      "https://github.com/siderolabs/talos/releases/download/${TALOS_VERSION}/talosctl-linux-amd64" \
 && chmod +x /usr/local/bin/talosctl

RUN KUBECTL_VERSION="$(curl -sfL https://dl.k8s.io/release/stable.txt)" \
 && curl -sfL -o /usr/local/bin/kubectl \
      "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
 && chmod +x /usr/local/bin/kubectl

RUN curl -sfL https://fluxcd.io/install.sh | bash

RUN curl -sfL "https://github.com/vmware-tanzu/velero/releases/download/${VELERO_VERSION}/velero-${VELERO_VERSION}-linux-amd64.tar.gz" \
      | tar -xz -C /tmp \
 && install "/tmp/velero-${VELERO_VERSION}-linux-amd64/velero" /usr/local/bin/velero \
 && rm -rf "/tmp/velero-${VELERO_VERSION}-linux-amd64"
