# Controlling Docker Containers in Jenkins Pipeline

**URL:** <https://forum.robotframework.org/t/controlling-docker-containers-in-jenkins-pipeline/2733>\
**Category:** Browser\
**Created:** [5 November 2021 15:25 UTC](https://forum.robotframework.org/t/controlling-docker-containers-in-jenkins-pipeline/2733 "2021-11-05T15:25:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlonizag](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/marlonizag/32/910_2.png) [@marlonizag](https://forum.robotframework.org/u/marlonizag)\
**Post date:** [5 November 2021 15:25 UTC](https://forum.robotframework.org/t/controlling-docker-containers-in-jenkins-pipeline/2733/1 "2021-11-05T15:25:33Z")

</div>

Hello everyone,

I’ve been able to create a few robot test files that run in a docker image and have also successfully created a Jenkins file that takes all my robot files, starts docker image, and runs tests. All of that is great; however, there is one thing I haven’t been able to figure due to my lack of experience.

I want to create a robot test file that can start/stop a docker container while running inside Jenkins. Locally in my computer, I can use the Process library to run docker command from CLI and it works fine. However, from my research, it seems this is not possible when running robot file in Jenkins because you lose access to those container due to security reasons. Essentially, using `Run Process` keyword does not work in Jenkins and was wondering if there’s a way I can get around this? I hope this make sense and I would be more than happy to answer any questions. Thank you in advance for your help !

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [5 November 2021 18:49 UTC](https://forum.robotframework.org/t/controlling-docker-containers-in-jenkins-pipeline/2733/2 "2021-11-05T18:49:28Z")

</div>

Here are my experiments if I was in your scenario:

- Try to use can use SSHLibrary to run the commands
- Try to use Docker plugin in Jenkins (maybe not what you want)
- Try to change the container to have a daemon looking for a certain file in the shared directory.
- Use your computer as a **node** of Jenkins, with access to the container/commands.

---

<div class="post-metadata">

**Author:** ![marlonizag](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/marlonizag/32/910_2.png) [@marlonizag](https://forum.robotframework.org/u/marlonizag)\
**Post date:** [19 November 2021 19:45 UTC](https://forum.robotframework.org/t/controlling-docker-containers-in-jenkins-pipeline/2733/3 "2021-11-19T19:45:40Z")

</div>

Hi Hélio Guilherme,

Thank you so much for your help! I went down the list you provided to see which solution worked with that I was looking for. I ended up changing the container to have a docker daemon.
