Why would you need this ?
I needed this to access my jenkins instance using context path e.g. www.abc.com/jenkins. Anyway I resolved it by passing jenkins launcher arguments --prefix=/jenkins at the end.
To complete the final answer, if you want to do this in a _docker-compose.yml_ file:
...
jenkins:
container_name: jenkins_test
environment:
- JENKINS_OPTS="--prefix=/jenkins"
...
Most helpful comment
To complete the final answer, if you want to do this in a _docker-compose.yml_ file: