Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

You should have Docker properly installed on your machine. Check Docker installation guide for details.

First, pull the official jenkins image from Docker repository.

Code Block
docker pull jenkins

Next, run a container using this image and map data directory from the container to the host; e.g in the example below /var/jenkins_home from the container is mapped to jenkins/ directory from the current path on the host. Jenkins 8080 port is also exposed to the host as 49001.

Code Block
docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins

Addtionally, you can configure nginx as a reverse proxy to your Jenkins instance, e.g.

Code Block
upstream app {
    server 127.0.0.1:49001;
}
server {
    listen 80;
    server_name jenkins.your-domain.com;

    location / {
        proxy_pass http://app;
    }
}