Now that we have data volumes for development and staging, let's spawn the containers using them:
- To create a Jenkins staging instance named jenkins_staging using the jenkins-home-staging data volume, run the following command:
sudo docker run -d --name jenkins_staging \ -v jenkins-home-staging:/var/jenkins_home -p 8081:8080 \ -p 50001:50000 jenkins/jenkins:lts
The previous command will create a Jenkins instance running on port 8080 and mapped to port 8081 of the Docker host. We choose a different port on Docker host because we already have our Jenkins production instance, jenkins_prod, running on port 8080, which is mapped to port 8080 of the Docker host.
The same reason applies to mapping ...