Many times you are in need of a development or a staging instance of your Jenkins production server to test something new. Docker makes it easy and safe to create multiple instances of your Jenkins servers.
Here is how to do it. In this section, we will create a development and a staging instance of Jenkins using our Jenkins production instance.
Before we begin, make sure you have the following things ready:
- We need a Docker host running a Jenkins instance (production), utilizing data volumes
- Refer to the Running a Jenkins container using a data volume section
We will create a data volume named jenkins-home-staging
and jenkins-home-development
for our staging and development instances of Jenkins, respectively:
sudo docker volume create --name jenkins-home-staging
- To create an empty
jenkins-home-development
data volume...