Jenkins Deployment Example

Jenkins is a widely-used automation server for continuous integration and delivery. With Instantly.run, you can quickly deploy Jenkins for your CI/CD needs.

Step-by-Step Guide

This guide demonstrates how to deploy a Jenkins instance using Instantly.run.

Deployment Command

docker run --context=instantly --name jenkins-instance --domainname ci.example.com \
-e JENKINS_OPTS="--prefix=/jenkins" -p 8080:8080 -p 50000:50000 \
-v hdd:/var/jenkins_home

Command Breakdown

  • --context=instantly: Ensures the container is managed under the Instantly.run context.
  • --name jenkins-instance: Assigns the container a unique name for reference.
  • --domainname ci.example.com: Assigns the container a public domain.
  • Environment Variables:
    • JENKINS_OPTS: Specifies Jenkins options, such as setting a prefix.
  • -p 8080:8080: Maps Jenkins' web interface port to the host.
  • -p 50000:50000: Maps the Jenkins agent communication port.
  • -v hdd:/var/jenkins_home: Mounts a volume to persist Jenkins data.

Accessing the Deployment

  • Public Domain: Once deployed, your Jenkins instance will be accessible at https://ci.example.com/jenkins.
  • Automatic SSL: An SSL certificate will be automatically generated for the domain, and HTTP traffic will redirect to HTTPS.

Modifying the Deployment

To make updates (e.g., change the prefix or add volumes), re-run the command with updated parameters. For example, to change the volume mapping:

docker run --context=instantly --name jenkins-instance --domainname ci.example.com \
-e JENKINS_OPTS="--prefix=/jenkins" -p 8080:8080 -p 50000:50000 \
-v ssd:/var/jenkins_home

Additional Configuration

For more configuration options, refer to the Jenkins Docker Documentation.