> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/admin-guide/continuous-integration/run-jenkins-container.md).

# Run Jenkins in a container

Running Jenkins inside a container is a common setup. This article shows you how to set up Jenkins to run in a container so that it can build and scan Docker images.

## Setting up and starting a Jenkins container

To set up Jenkins to run in a container:

**Prerequisite:** You have already installed Docker on the host machine.

1. Create the following Dockerfile. It uses the base Jenkins image and sets up the required permissions for the jenkins user.

   ```
   FROM jenkins/jenkins:lts

   USER root
   RUN apt-get update \
         && apt-get install -y sudo libltdl7 \
         && rm -rf /var/lib/apt/lists/*
   RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
   ```
2. Build the image.

   ```
   $ docker build -t jenkins_docker .
   ```
3. Run the Jenkins container, giving it access to the docker socket.

   ```
   $ docker run -d -v /var/run/docker.sock:/var/run/docker.sock \
     -v $(which docker):/usr/bin/docker -p 8080:8080 jenkins_docker
   ```
4. Open a browser and navigate to \<JENKINS\_HOST>:8080.
5. Install the Prisma Cloud plugin.

   For more information, see [Jenkins plugin](/admin-guide/continuous-integration/jenkins-plugin.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/admin-guide/continuous-integration/run-jenkins-container.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
