Skip to content

Commit 560215e

Browse files
authored
chore: network aliases (#1282)
1 parent 2683449 commit 560215e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docker-compose.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ services:
1414
volumes:
1515
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /ssh-dir path inside the container
1616
# The healthcheck command checks if the conductor_ok file exists in the /ssh-dir directory.
17+
networks:
18+
- jenkins-net
1719
healthcheck:
1820
test: ["CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1"]
1921
# Checks if the conductor_ok file exists in the /ssh-dir path
@@ -38,6 +40,8 @@ services:
3840
- dotnet
3941
- default
4042
# This service depends on the sidekick_service (generating SSH keys and JCasc token) completing successfully.
43+
networks:
44+
- jenkins-net
4145
depends_on:
4246
sidekick_service:
4347
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -76,6 +80,10 @@ services:
7680
# Mounting the token as "container secret" makes it available in JCasc as the variable ${CASC_RELOAD_TOKEN}
7781
- ./secrets/jcasc_token:/run/secrets/CASC_RELOAD_TOKEN:ro
7882
# This service depends on the sidekick_service (generating SSH keys and JCasc token) completing successfully.
83+
networks:
84+
jenkins-net:
85+
aliases:
86+
- jenkins_controller # Add secondary alias
7987
depends_on:
8088
sidekick_service:
8189
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -97,6 +105,8 @@ services:
97105
- empty_jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
98106
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
99107
# This service depends on the sidekick_service (generating SSH keys and JCasc token) completing successfully.
108+
networks:
109+
- jenkins-net
100110
depends_on:
101111
sidekick_service:
102112
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -115,6 +125,8 @@ services:
115125
container_name: desktop-jenkins_agent-1
116126
profiles:
117127
- default
128+
networks:
129+
- jenkins-net
118130
depends_on:
119131
sidekick_service:
120132
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -133,6 +145,8 @@ services:
133145
container_name: desktop-jenkins_agent-1
134146
profiles:
135147
- wizard
148+
networks:
149+
- jenkins-net
136150
depends_on:
137151
sidekick_service:
138152
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -145,6 +159,8 @@ services:
145159
container_name: desktop-jenkins_agent-1-maven
146160
profiles:
147161
- maven
162+
networks:
163+
- jenkins-net
148164
depends_on:
149165
sidekick_service:
150166
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -163,6 +179,8 @@ services:
163179
container_name: desktop-jenkins_agent-1-python
164180
profiles:
165181
- python
182+
networks:
183+
- jenkins-net
166184
depends_on:
167185
sidekick_service:
168186
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -183,6 +201,8 @@ services:
183201
container_name: desktop-jenkins_agent-1-node
184202
profiles:
185203
- node
204+
networks:
205+
- jenkins-net
186206
depends_on:
187207
sidekick_service:
188208
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -205,6 +225,8 @@ services:
205225
container_name: desktop-jenkins_agent-1-android
206226
profiles:
207227
- android
228+
networks:
229+
- jenkins-net
208230
depends_on:
209231
sidekick_service:
210232
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -227,6 +249,8 @@ services:
227249
- "8080:8080"
228250
profiles:
229251
- multi
252+
networks:
253+
- jenkins-net
230254
volumes:
231255
- jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
232256
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
@@ -246,6 +270,8 @@ services:
246270
container_name: desktop-jenkins_agent-1-multi
247271
profiles:
248272
- multi
273+
networks:
274+
- jenkins-net
249275
depends_on:
250276
sidekick_service:
251277
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -269,6 +295,8 @@ services:
269295
container_name: desktop-jenkins_agent-1-golang
270296
profiles:
271297
- golang
298+
networks:
299+
- jenkins-net
272300
depends_on:
273301
sidekick_service:
274302
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -291,6 +319,8 @@ services:
291319
container_name: desktop-jenkins_agent-1
292320
profiles:
293321
- cpp
322+
networks:
323+
- jenkins-net
294324
depends_on:
295325
sidekick_service:
296326
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -313,6 +343,8 @@ services:
313343
container_name: desktop-jenkins_agent-1
314344
profiles:
315345
- dotnet
346+
networks:
347+
- jenkins-net
316348
depends_on:
317349
sidekick_service:
318350
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
@@ -333,3 +365,8 @@ volumes:
333365
empty_jenkins_home: null
334366
agent-ssh-dir:
335367
name: agent-ssh-dir # Creates a named volume called agent-ssh-dir
368+
369+
networks:
370+
jenkins-net:
371+
driver: bridge
372+
attachable: true

0 commit comments

Comments
 (0)