# Best practices for Jenkins Controller in Dockerfile?

**URL:** https://community.jenkins.io/t/best-practices-for-jenkins-controller-in-dockerfile/2393
**Category:** Using Jenkins
**Tags:** question, docker
**Created:** [May 11, 2022, 11:03pm UTC](https://community.jenkins.io/t/best-practices-for-jenkins-controller-in-dockerfile/2393 "2022-05-11T23:03:27Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)
#### Post date: [May 12, 2022, 12:23am UTC](https://community.jenkins.io/t/best-practices-for-jenkins-controller-in-dockerfile/2393/2 "2022-05-12T00:23:10Z")

</div>

> [@gc\_mduffy](#):
>
> because the plugins directory must be in jenkins\_home

thats not entirely true. I’d have to go dig and find out the specifics but you can shove plugins in /usr/share/jenkins/ref/plugins/ and that will copy over (without replacing) into $JENKINS\_HOME/plugins

So, you could update your entrypoint to delete $JENKINS\_HOME/plugins every startup

I use helm which has a flag to delete the contents of the directory, but my docker image has all the plugins in the ref directory

> <https://github.com/halkeye-docker/docker-jenkins/blob/e2dd31f0371c14cb77d2440086f620c6639eb134/Dockerfile#L2-L3>

(ignore the env CASC\_HOME as helm overrides it, and i was just lazy to remove that line from the docker file)

---

_[View the full topic](https://community.jenkins.io/t/best-practices-for-jenkins-controller-in-dockerfile/2393)._
