Jenkins build agent with Java and Node.js LTS. Jenkins connects to it over SSH.
It extends the official jenkins/ssh-agent image with Node.js from the official node image. Images are built for linux/amd64 and linux/arm64 and ship with an SBOM, build provenance and a keyless signature.
Images are published to GitHub Container Registry as ghcr.io/think-cube/jenkins-agent-node.
| Tag | Meaning | Changes? |
|---|---|---|
1.0.0 |
Exact release | Never |
1.0, 1, latest |
Newest matching release | With each release |
edge |
Newest build of main |
With each merge and weekly rebuild |
edge-YYYYMMDD |
Weekly rebuild of main with current OS patches |
Never |
sha-<commit> |
Build of one main commit |
Never |
For production, pin by digest: ghcr.io/think-cube/jenkins-agent-node:1.0.0@sha256:....
- Java runtime, SSH server,
gitandgit-lfsfromjenkins/ssh-agent - Node.js LTS with
npmandnpx
The exact versions are on the FROM lines of the Dockerfile. A new major Node.js line is adopted deliberately, in a new major version of this image.
Start the agent with the public half of the key Jenkins will use:
docker run -d --name jenkins-agent \
-p 2222:22 \
-e "JENKINS_AGENT_SSH_PUBKEY=ssh-ed25519 AAAA..." \
ghcr.io/think-cube/jenkins-agent-node:1The key can also be passed as the first argument instead of the environment variable.
In Jenkins, add a node that launches via SSH:
- Host: the Docker host, Port:
2222 - Credentials: SSH username
jenkinswith the matching private key - Remote root directory:
/home/jenkins/agent - Host key verification: verify against the agent's host key, which is generated on first start and kept in the container
Root login and password authentication are disabled. sshd runs as root inside the container because it has to switch to the jenkins user for each session; builds run as jenkins (UID/GID 1000).
| Variable | Description |
|---|---|
JENKINS_AGENT_SSH_PUBKEY |
Public key allowed to log in as jenkins |
Other variables passed with -e are visible to build sessions as well.
Check the signature:
cosign verify ghcr.io/think-cube/jenkins-agent-node:1.0.0 \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp '^https://github\.com/Think-Cube/workflows/\.github/workflows/container-image\.yml@refs/tags/v.+$'Read the SBOM and provenance:
docker buildx imagetools inspect ghcr.io/think-cube/jenkins-agent-node:1.0.0 --format '{{ json .SBOM }}'
docker buildx imagetools inspect ghcr.io/think-cube/jenkins-agent-node:1.0.0 --format '{{ json .Provenance }}'docker build -t jenkins-agent-node:local .
bash tests/smoke.sh jenkins-agent-node:localThe smoke test starts the agent, logs in over SSH with a throwaway key the way Jenkins does, and checks the tools and the SSH hardening.
Only the newest release receives fixes. main is rebuilt every week, and images with fixable critical vulnerabilities are not published. Report security issues through GitHub private vulnerability reporting.
This project is licensed under the MIT License.
Feel free to contribute by opening issues or pull requests. Your feedback and improvements are highly appreciated!