# Jenkins - Docker cloud agent VS Docker in Pipeline

**URL:** <https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919>\
**Category:** Using Jenkins\
**Tags:** docker, pipeline\
**Created:** [July 10, 2024, 3:33am UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919 "2024-07-10T03:33:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Padmahas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/padmahas/32/8954_2.png) [@Padmahas](https://community.jenkins.io/u/Padmahas)\
**Post date:** [July 10, 2024, 3:33am UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919/1 "2024-07-10T03:33:10Z")

</div>

I’m trying to understand why so many people have taken the route of setting up “Docker cloud agent” inside Manage Jenkins → Clouds, instead of just going with “Docker agent” inside pipeline, which is officially supported.

In my view, if I go with “Docker cloud agent” way,

1. I have to login to the server where Jenkins is hosted.
2. I need to edit Docker’s service file “/lib/systemd/system/docker.service” and expose REST API port manually.
3. Do the setup in Manage Jenkins Cloud.
4. Create a Docker image of your own.
5. Add that Docker image under “Docker agent template”
6. Then finally refer that template’s name in the pipeline.

Instead of all these extra steps, if I go with “Docker agent” support inside pipeline directly official documentation,

1. I don’t even need to login to server where Jenkins is hosted.
2. I can also do more customization using “Dockerfile” and committing it to the source code.

What is the exact reason for choosing OR when should I choose “Docker cloud agent”?

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/system/32/4910_2.png) [@system](https://community.jenkins.io/u/system)\
**Post date:** [July 10, 2024, 3:35am UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919/2 "2024-07-10T03:35:15Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/system/32/4910_2.png) [@system](https://community.jenkins.io/u/system)\
**Post date:** [July 11, 2024, 5:26am UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919/5 "2024-07-11T05:26:17Z")

</div>



---

<div class="post-metadata">

**Author:** ![Padmahas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/padmahas/32/8954_2.png) [@Padmahas](https://community.jenkins.io/u/Padmahas)\
**Post date:** [August 6, 2024, 4:54pm UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919/6 "2024-08-06T16:54:21Z")

</div>

One more observation I’ve made is, On step 4, while creating your own Docker image, you should always use “jenkins/agent:[XYZ]” as base image mandatorily.

Assume if you want JDK 8 for your project. But since both JDK version of Jenkins and JDK version of agents have to be same, you will be forced to use “jenkins/agent:jdk17” as base image and manually install JDK 8 along with JDK 17 and refer that JDK 8 during the build stage.

---

<div class="post-metadata">

**Author:** ![ctubbsii](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ctubbsii/32/21072_2.png) [@ctubbsii](https://community.jenkins.io/u/ctubbsii)\
**Post date:** [April 24, 2026, 7:43pm UTC](https://community.jenkins.io/t/jenkins-docker-cloud-agent-vs-docker-in-pipeline/16919/7 "2026-04-24T19:43:23Z")

</div>

I think there are a few benefits to setting up the cloud agents:

1. Ability to specify different agent templates, with quotas
2. Ability to decouple your job configuration from the agent executor configuration, by selecting agents based on labels, without regard to how the administrator has chosen to configure those executors

🙂
