For the below docker-compose building docker file dynamically:
version: '2'
volumes:
jenkins_home:
external: true
services:
jenkins:
build:
context: .
args:
DOCKER_GID: ${DOCKER_GID}
DOCKER_ENGINE: ${DOCKER_ENGINE}
DOCKER_COMPOSE: ${DOCKER_COMPOSE}
volumes:
- jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8080:8080"
creates bridge type network (project1_default
) is created:
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
....
f1b7ca7c6dfe project1_default bridge local
....
after running below command:
$ docker-compose -p project1 up -d
After launching and connecting to master jenkins, we configure and create slave jenkins on separate EC2 host using EC2 plugin of master jenkins.
But, above network (project1_default
) is single host network, that can allow packets travel within single host. Below is my visualisation of bridge type network (project1_default
)...
So, we need to launch and configure master jenkins to launch a slave jenkins on separate EC2 hosts using EC2 plugin,
Do I need to create multi-host network(
swarm
) type? instead of bridge type (project1_default
)...If yes, how to create a multi-host network?