O'Reilly logo

Docker Orchestration by Randall Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing applications

A Mesos cluster is managed with the dcos tool and the web interface. Applications in Mesos are handled by the Marathon scheduler and are defined in JSON format.

Running a simple application

Let's start with a simple container that runs Nginx. Create a file named nginx.json that contains the following definition:

{ 
  "id" : "simple-nginx", 
  "instances" : 1, 
  "cpus" : 0.25, 
  "mem" : 64.0, 
  "container" : { 
    "type" : "DOCKER", 
    "docker" : { 
      "image" : "nginx:1.11", 
      "network" : "HOST" 
    } 
  } 
} 

The id tag is the name of the service. It is displayed in the service list. The instances tag tells Marathon that only one instance is needed. It can be increased or decreased as needed later.

The cpus and mem tags are hints to Marathon as to what percentage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required