FROM debian:12-slim as kubectl RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ && rm -rf /var/lib/apt/lists/* RUN V="$(curl -sSL https://dl.k8s.io/release/stable.txt)" \ && curl -Lo /kubectl "https://dl.k8s.io/release/$V/bin/linux/amd64/kubectl" FROM debian:12-slim RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ && rm -rf /var/lib/apt/lists/* COPY --from=kubectl --chmod=0755 /kubectl /usr/local/bin/ COPY k8sdeploy.sh /usr/local/bin/ RUN useradd -m app USER app ENTRYPOINT ["k8sdeploy.sh"]