Files
software-infrastructure/images/ci-tools/Dockerfile
T
claudeandClaude Opus 5.5 1b197efc64 G1: shared CI tools image (prepared, not yet built in CI)
Add images/ci-tools: one image with ansible 14.6.0 (core 2.21.6),
ansible-lint, yamllint, helm 3.22.1, kubeconform, actionlint, hadolint,
gitleaks and node 24 for JavaScript actions. Python tools are pinned in
requirements.txt; binaries are pinned by version and the SHA-256 from
each release's checksum file. VERSION starts at 1.0.0.

Add a manual-only ci-tools-image workflow that builds and smoke-tests
the image, and publishes an immutable version tag only when Eric enables
CI_TOOLS_PUBLISH and adds a registry token (after S8 and P1). A sample
job then uses the published image as its container.

Tested on the workstation: image builds, every tool reports its pinned
version, hadolint/actionlint pass on the new files, and syntax-check
passes for gitea.yaml, ci-runner.yaml and prometheus.yaml inside it.

Refs DevOps/software-infrastructure#49

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:16:28 -05:00

58 lines
2.8 KiB
Docker

# eom.dev CI tools image (DevOps/software-infrastructure#49, G1).
# Everything a lint/validate job needs, at pinned versions, so jobs start
# without installing anything. Bump VERSION when anything here changes.
# Node is only here so JavaScript actions (actions/checkout etc.) can run
# inside a job that uses this image as its container.
FROM node:24.22.3-trixie-slim AS node
FROM python:3.13.18-slim-trixie
ARG HELM_VERSION=3.22.1
ARG HELM_SHA256=896cf63684a42a723d61c980369d6e588330927deb13676ca0d85006dd6da0ea
ARG KUBECONFORM_VERSION=0.8.0
ARG KUBECONFORM_SHA256=9bc2bffbf71f261128533edaf912153948b7ff238f9a531ae6d34466ec287883
ARG ACTIONLINT_VERSION=1.7.12
ARG ACTIONLINT_SHA256=8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
ARG HADOLINT_VERSION=2.15.1
ARG HADOLINT_SHA256=c7187db94eeeeca956519a6af171adc31453941a1e777961f6e680f697c8c507
ARG GITLEAKS_VERSION=8.30.1
ARG GITLEAKS_SHA256=551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl git openssh-client jq rsync \
&& rm -rf /var/lib/apt/lists/*
COPY --from=node /usr/local/bin/node /usr/local/bin/node
WORKDIR /tmp/tools
RUN fetch() { curl -fsSL --retry 3 -o "$2" "$1" && echo "$3 $2" | sha256sum -c -; } \
&& fetch "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" helm.tgz "${HELM_SHA256}" \
&& tar -xzf helm.tgz --strip-components=1 linux-amd64/helm \
&& fetch "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" kubeconform.tgz "${KUBECONFORM_SHA256}" \
&& tar -xzf kubeconform.tgz kubeconform \
&& fetch "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" actionlint.tgz "${ACTIONLINT_SHA256}" \
&& tar -xzf actionlint.tgz actionlint \
&& fetch "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-linux-x86_64" hadolint "${HADOLINT_SHA256}" \
&& fetch "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" gitleaks.tgz "${GITLEAKS_SHA256}" \
&& tar -xzf gitleaks.tgz gitleaks \
&& install -m 0755 helm kubeconform actionlint hadolint gitleaks /usr/local/bin/ \
&& rm -rf /tmp/tools
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt
COPY VERSION /etc/eom-ci-tools-version
COPY versions.sh /usr/local/bin/ci-tools-versions
# Jobs run as root in act_runner job containers; keep the default user so
# actions/checkout can write the workspace.
WORKDIR /workspace
ENV ANSIBLE_FORCE_COLOR=1 PIP_DISABLE_PIP_VERSION_CHECK=1
CMD ["ci-tools-versions"]