Sunday, May 21, 2017

Continuous Delivery with Docker on Mesos and Marathon

Full functional development and continuous integration environments


  • Here is the full docker-compose.yml file that includes all parts of the system.
  • In addition to Jenkins and Docker registry we have Mesos master, single Mesos slave, Mesosphere Marathon and Zookeeper for internal Mesos communication.
docker-compose.yml
===============================================
version: '3'
services:
  zookeeper:
    image: garland/zookeeper
    hostname: "zookeeper"
    container_name: zookeeper
    ports:
      - "2181:2181"
      - "2888:2888"
      - "3888:3888"
  mesos-master:
    image: garland/mesosphere-docker-mesos-master
    hostname: "mesos-master"
    container_name: mesos-master
    environment:
      - MESOS_QUORUM=1
      - MESOS_ZK=zk://192.168.99.100:2181/mesos
      - MESOS_REGISTRY=in_memory
      - MESOS_LOG_DIR=C:/var/log/mesos
      - MESOS_WORK_DIR=C:/var/lib/mesos
    links:
      - zookeeper:zk
    ports:
      - "5050:5050"
  mesos-slave:
    image: garland/mesosphere-docker-mesos-master:latest
    hostname: "mesos-slave-1"
    container_name: mesos-slave-1
    environment:
      - MESOS_HOSTNAME=192.168.99.100
      - MESOS_MASTER=zk://192.168.99.100:2181/mesos
      - MESOS_LOG_DIR=C:/var/log/mesos
      - MESOS_LOGGING_LEVEL=INFO
    entrypoint: mesos-slave
    links:
      - zookeeper:zk
      - mesos-master:master
    ports:
      - "5151:5151"
  marathon:
    image: garland/mesosphere-docker-marathon
    hostname: "marathon"
    container_name: marathon
    environment:
      - MARATHON_MASTER=zk://192.168.99.100:2181/mesos
      - MARATHON_ZK=zk://192.168.99.100:2181/marathon
    command: --master zk://zk:2181/mesos --zk zk://zk:2181/marathon
    links:
      - zookeeper:zk
      - mesos-master:master
    ports:
      - "8080:8080"
###Environment 
===============================================


It is important to note that the Jenkins container now includes a link to Marathon. This is required to be able to post the requests from the Jenkins container to the Marathon container.

Now we can restart the system and see it all up and running:
docker-compose up


No comments:

Post a Comment