{"id":14155260,"url":"https://github.com/jenkinsci/docker-agent","last_synced_at":"2025-05-15T12:07:28.875Z","repository":{"id":39635154,"uuid":"42661425","full_name":"jenkinsci/docker-agent","owner":"jenkinsci","description":"Jenkins agent (base image) and inbound agent Docker images","archived":false,"fork":false,"pushed_at":"2025-05-14T01:33:38.000Z","size":1901,"stargazers_count":303,"open_issues_count":18,"forks_count":234,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-14T03:26:14.909Z","etag":null,"topics":["agent","docker","hacktoberfest","jenkins","remoting"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jenkins/inbound-agent/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"community_bridge":"jenkins","custom":["https://jenkins.io/donate/#why-donate"]}},"created_at":"2015-09-17T14:37:19.000Z","updated_at":"2025-05-10T07:20:52.000Z","dependencies_parsed_at":"2022-07-10T22:33:31.452Z","dependency_job_id":"d7789bd5-5726-4696-978c-b7d69ef2d331","html_url":"https://github.com/jenkinsci/docker-agent","commit_stats":{"total_commits":473,"total_committers":53,"mean_commits":8.924528301886792,"dds":0.7970401691331924,"last_synced_commit":"fb58dabebc84ee0d8b7e2b658a88f62f49fac90a"},"previous_names":[],"tags_count":199,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fdocker-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fdocker-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fdocker-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fdocker-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/docker-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337608,"owners_count":22054254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","docker","hacktoberfest","jenkins","remoting"],"created_at":"2024-08-17T08:02:36.072Z","updated_at":"2025-05-15T12:07:23.860Z","avatar_url":"https://github.com/jenkinsci.png","language":"PowerShell","funding_links":["https://funding.communitybridge.org/projects/jenkins","https://jenkins.io/donate/#why-donate"],"categories":["agent"],"sub_categories":[],"readme":"# Jenkins Agent and Inbound Agent Docker images\n\n[![Join the chat at https://gitter.im/jenkinsci/docker](https://badges.gitter.im/jenkinsci/docker.svg)](https://gitter.im/jenkinsci/docker?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![GitHub stars](https://img.shields.io/github/stars/jenkinsci/docker-agent?label=GitHub%20stars)](https://github.com/jenkinsci/docker-agent)\n[![GitHub release](https://img.shields.io/github/release/jenkinsci/docker-agent.svg?label=changelog)](https://github.com/jenkinsci/docker-agent/releases/latest)\n\nThis repository contains the definition of Jenkins agent and inbound agent Docker images.\n\n## agent\n[![Docker Pulls](https://img.shields.io/docker/pulls/jenkins/agent.svg)](https://hub.docker.com/r/jenkins/agent/)\n\nThis is a base image for Docker, which includes JDK and the Jenkins agent executable (agent.jar).\n\nSee [the `agent` README](./README_agent.md)\n\n## inbound-agent\n[![Docker Pulls](https://img.shields.io/docker/pulls/jenkins/inbound-agent.svg)](https://hub.docker.com/r/jenkins/inbound-agent/)\n\nThis is an image based on `agent` for [Jenkins](https://jenkins.io) agents using TCP or WebSockets to establish inbound connection to the Jenkins controller.\n\nSee [the `inbound-agent` README](./README_inbound-agent.md)\n\n## Building\n\n### Building and testing on Linux\n\n#### Target images\n\nIf you want to see the target images (matching your current architecture) that will be built, you can issue the following command:\n\n```bash\n$ make list\nagent_alpine_jdk17\nagent_alpine_jdk21\nagent_debian_jdk17\nagent_debian_jdk21\nagent_rhel_ubi9_jdk17\nagent_rhel_ubi9_jdk21\ninbound-agent_alpine_jdk17\ninbound-agent_alpine_jdk21\ninbound-agent_debian_jdk17\ninbound-agent_debian_jdk21\ninbound-agent_rhel_ubi9_jdk17\ninbound-agent_rhel_ubi9_jdk21\n```\n\n#### Building a specific image\n\nIf you want to build a specific image, you can issue the following command:\n\n```bash\nmake build-\u003cAGENT_TYPE\u003e_\u003cLINUX_FLAVOR\u003e_\u003cJDK_VERSION\u003e\n```\n\nThat would give for an image of an inbound agent with JDK 17 on Debian:\n\n```bash\nmake build-inbound-agent_debian_jdk17\n```\n\n#### Building images supported by your current architecture\n\nThen, you can build the images supported by your current architecture by running:\n\n```bash\nmake build\n```\n\n#### Testing all images\n\nIf you want to test these images, you can run:\n\n```bash\nmake test\n```\n#### Testing a specific image\n\nIf you want to test a specific image, you can run:\n\n```bash\nmake test-\u003cAGENT_TYPE\u003e_\u003cLINUX_FLAVOR\u003e_\u003cJDK_VERSION\u003e\n```\n\nThat would give for an image of an inbound agent with JDK 17 on Debian:\n\n```bash\nmake test-inbound-agent_debian_jdk17\n```\n\n#### Building all images\n\nYou can build all images (even those unsupported by your current architecture) by running:\n\n```bash\nmake every-build\n```\n\n#### Other `make` targets\n\n`show` (and `show-windows`) gives us a detailed view of the images that could be built, with tags, platforms, and Dockerfiles.\n\n```bash\n$ make show\n{\n  \"group\": {\n    \"alpine\": {\n      \"targets\": [\n        \"agent_alpine_jdk17\",\n        \"agent_alpine_jdk21\",\n        \"inbound-agent_alpine_jdk17\",\n        \"inbound-agent_alpine_jdk21\"\n      ]\n    },\n    \"debian\": {\n      \"targets\": [\n        \"agent_debian_jdk17\",\n        \"agent_debian_jdk21\",\n        \"inbound-agent_debian_jdk17\",\n        \"inbound-agent_debian_jdk21\"\n      ]\n    },\n    \"default\": {\n      \"targets\": [\n        \"linux\"\n      ]\n    },\n    \"linux\": {\n      \"targets\": [\n        \"alpine\",\n        \"debian\",\n        \"rhel_ubi9\"\n      ]\n    },\n    \"rhel_ubi9\": {\n      \"targets\": [\n        \"agent_rhel_ubi9_jdk17\",\n        \"agent_rhel_ubi9_jdk21\",\n        \"inbound-agent_rhel_ubi9_jdk17\",\n        \"inbound-agent_rhel_ubi9_jdk21\"\n      ]\n    }\n  },\n  \"target\": {\n    \"agent_alpine_jdk17\": {\n      \"context\": \".\",\n      \"dockerfile\": \"alpine/Dockerfile\",\n      \"args\": {\n        \"ALPINE_TAG\": \"3.20.3\",\n        \"JAVA_VERSION\": \"17.0.12_7\",\n        \"VERSION\": \"3261.v9c670a_4748a_9\"\n      },\n      \"tags\": [\n        \"docker.io/jenkins/agent:alpine\",\n        \"docker.io/jenkins/agent:alpine3.20\",\n        \"docker.io/jenkins/agent:latest-alpine\",\n        \"docker.io/jenkins/agent:latest-alpine3.20\",\n        \"docker.io/jenkins/agent:alpine-jdk17\",\n        \"docker.io/jenkins/agent:alpine3.20-jdk17\",\n        \"docker.io/jenkins/agent:latest-alpine-jdk17\",\n        \"docker.io/jenkins/agent:latest-alpine3.20-jdk17\"\n      ],\n      \"target\": \"agent\",\n      \"platforms\": [\n        \"linux/amd64\"\n      ],\n      \"output\": [\n        \"type=docker\"\n      ]\n    },\n    [...]\n```\n\nTo view all tags, set `ON_TAG` (and eventually `BUILD_NUMBER`):\n```bash\n$ ON_TAG=true BUILD_NUMBER=3 make show\n[...]\n  \"target\": {\n    \"agent_alpine_jdk17\": {\n      \"context\": \".\",\n      \"dockerfile\": \"alpine/Dockerfile\",\n      \"args\": {\n        \"ALPINE_TAG\": \"3.21.3\",\n        \"JAVA_VERSION\": \"17.0.14_7\",\n        \"VERSION\": \"3283.v92c105e0f819\"\n      },\n      \"tags\": [\n        \"docker.io/jenkins/agent:3283.v92c105e0f819-3-alpine-jdk17\",\n        \"docker.io/jenkins/agent:3283.v92c105e0f819-3-alpine3.21-jdk17\",\n        \"docker.io/jenkins/agent:3283.v92c105e0f819-3-alpine\",\n        \"docker.io/jenkins/agent:3283.v92c105e0f819-3-alpine3.21\",\n        \"docker.io/jenkins/agent:alpine\",\n        \"docker.io/jenkins/agent:alpine3.21\",\n        \"docker.io/jenkins/agent:latest-alpine\",\n        \"docker.io/jenkins/agent:latest-alpine3.21\",\n        \"docker.io/jenkins/agent:alpine-jdk17\",\n        \"docker.io/jenkins/agent:alpine3.21-jdk17\",\n        \"docker.io/jenkins/agent:latest-alpine-jdk17\",\n        \"docker.io/jenkins/agent:latest-alpine3.21-jdk17\"\n      ],\n      [...]\n```\n\n`bats` is a dependency target. It will update the [`bats` submodule](https://github.com/bats-core/bats-core) and run the tests.\n\n```bash\nmake bats\nmake: 'bats' is up to date.\n```\n\n`publish` allows the publication of all images targeted by 'linux' to a registry.\n\n`docker-init` is dedicated to Jenkins infrastructure for initializing docker and isn't required in other contexts.\n\n### Building and testing on Windows\n\n#### Building all images\n\nRun `.\\build.ps1` to launch the build of the images corresponding to the \"windows\" target of docker-bake.hcl.\n\nInternally, the first time you'll run this script and if there is no build-windows_\u003cAGENT_TYPE\u003e_\u003cWINDOWS_FLAVOR\u003e_\u003cWINDOWS_VERSION\u003e.yaml file in your repository, it will use a combination of `docker buildx bake` and `yq` to generate a  build-windows_\u003cAGENT_TYPE\u003e_\u003cWINDOWS_FLAVOR\u003e_\u003cWINDOWS_VERSION\u003e.yaml docker compose file containing all Windows image definitions from docker-bake.hcl. Then it will run `docker compose` on this file to build these images.\n\nYou can modify this docker compose file as you want, then rerun `.\\build.ps1`.\nIt won't regenerate the docker compose file from docker-bake.hcl unless you add the `-OverwriteDockerComposeFile` build.ps1 parameter:  `.\\build.ps1 -OverwriteDockerComposeFile`.\n\nNote: you can generate this docker compose file from docker-bake.hcl yourself with the following command (require `docker buildx` and `yq`):\n\n```console\n# - Use docker buildx bake to output image definitions from the \"windows\" bake target\n# - Convert with yq to the format expected by docker compose\n# - Store the result in the docker compose file\n\n$ docker buildx bake --progress=plain --file=docker-bake.hcl windows --print `\n    | yq --prettyPrint '.target[] | del(.output) | {(. | key): {\\\"image\\\": .tags[0], \\\"build\\\": .}}' | yq '{\\\"services\\\": .}' `\n    | Out-File -FilePath build-windows_mybuild.yaml\n```\n\nNote that you don't need build.ps1 to build (or to publish) your images from this docker compose file, you can use `docker compose --file=build-windows_mybuild.yaml build`.\n\n#### Testing all images\n\nRun `.\\build.ps1 test` if you also want to run the tests harness suit.\n\nRun `.\\build.ps1 test -TestsDebug 'debug'` to also get commands \u0026 stderr of tests, displayed on top of them.\nYou can set it to `'verbose'` to also get stdout of every test command.\n\nNote that instead of passing `-TestsDebug` parameter to build.ps1, you can set the  $env:TESTS_DEBUG environment variable to the desired value.\n\nAlso note that contrary to the Linux part, you have to build the images before testing them.\n\n#### Dry run\n\nAdd the `-DryRun` parameter to print out any build, publish or tests commands instead of executing them: `.\\build.ps1 test -DryRun`\n\n#### Building and testing a specific image\n\nYou can build (and test) only one image type by setting `-ImageType` to a combination of Windows flavors (\"nanoserver\" \u0026 \"windowsservercore\") and Windows versions (\"1809\", \"ltsc2019\", \"ltsc2022\").\n\nEx: `.\\build.ps1 -ImageType 'nanoserver-ltsc2019'`\n\nWarning: trying to build `windowsservercore-1809` will fail as there is no corresponding image from Microsoft.\n\nYou can also build (and test) only one agent type by setting `-AgentType` to either \"agent\" or \"inbound-agent\".\n\nEx: `.\\build.ps1 -AgentType 'agent'`\n\nBoth parameters can be combined.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fdocker-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fdocker-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fdocker-agent/lists"}