Fork me on GitHub

Herr Knedel/Great things with containers: running Jenkins on the Synology DS

Created Sun, 21 Mar 2021 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:11:21 +0000 Difficulty level: It may take a little longer

246 Words

Step 1: Prepare Synology

The first thing to do is to enable SSH login on Diskstation. To do this, go to the “Control Panel” > “Terminal

After that you can log in via “SSH”, the specified port and the administrator password (Windows users take Putty or WinSCP). I log in via Terminal, winSCP or Putty and leave this console open for later.

Step 2: Prepare Docker folder

I create a new directory called “jenkins” in the Docker directory.

Then I change to the new directory and create a new folder “data”:
x
+
Terminal

$ sudo mkdir data

I also create a file called “jenkins.yml” with the following content. For the port, the front part “8081:” can be adjusted.

version: '2.0'
services:
  jenkins:
    restart: always
    image: jenkins/jenkins:lts
    privileged: true
    user: root
    ports:
      - 8081:8080
    container_name: jenkins
    volumes:
      - ./data:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/local/bin/docker:/usr/local/bin/docker

Step 3: Start

I can also make good use of the console in this step. I start the Jenkins server via Docker Compose.

x
+
Terminal

$ sudo docker-compose -f jenkins.yml up -d

After that I can call my Jenkins server with the IP of the diskstation and the assigned port from “Step 2”.

Step 4: Setup

Again, I use the console to read the initial password:
x
+
Terminal

$ cat data/secrets/initialAdminPassword

See: I have selected the “Recommended installation”.

Step 5: My first job

I log in and create my Docker job.

As you can see, everything works great!