-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
41 lines (38 loc) · 1.54 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
version: '2'
services:
jenkins-master:
container_name: jenkins-master
hostname: jenkins-master
# We can use jenkins image staright and it would result the same but its better to cache plugin install from Dockerfile
# image: jenkins/jenkins:lts
build: ./jenkins-master
environment:
- "JAVA_OPTS=-Djenkins.install.runSetupWizard=false -Djava.awt.headless=true -Djenkins.slaves.DefaultJnlpSlaveReceiver.disableStrictVerification=true"
- "JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false"
- "PROJECT_GIT=https://github.com/hasnat/stateless-jenkins.git"
- "PROJECT_NAME=Stateless Jenkins"
- "PROJECT_BUILD=true"
- "PROJECT_PLUGINS="
ports:
- "8080:8080"
volumes:
#- "./.ssh:/var/jenkins_home/.ssh:ro"
- "./projects:/usr/local/jenkins-projects"
- "./jenkins-slave-secret:/var/jenkins_secrets"
- "./init.d:/usr/share/jenkins/ref/init.groovy.d"
jenkins-slave:
container_name: jenkins-slave
hostname: jenkins-slave
build: ./jenkins-slave
privileged: true
restart: always
environment:
- JENKINS_URL=http://jenkins-master:8080
- JENKINS_NAME=docker-agent
#- JENKINS_SECRET=this_is_moved_to_entrypoint
- JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./projects:/usr/local/jenkins-projects"
- "./jenkins-slave-secret:/var/jenkins_secrets"
- "./init.d:/usr/share/jenkins/ref/init.groovy.d"