dcos marathon app add

Adding an application

Description

The dcos marathon app add command allows you to add an application.

Usage

  1. dcos marathon app add <app-resource>

Options

NameDescription
—helpShow this message and exit.

Positional arguments

NameDescription
<app-resource>Path to a file or HTTP(S) URL that contains the app’s JSON definition. If omitted, the definition is read from stdin. For a detailed description, see the documentation.

Examples

Deploy a simple app

In this example, a simple app is deployed to DC/OS Marathon.

  1. Create an app definition file named my-app.json with these contents.

    1. {
    2. "id": "/my-app",
    3. "networks": [
    4. { "mode": "container/bridge" }
    5. ],
    6. "container": {
    7. "type": "DOCKER",
    8. "docker": { "image": "group/image" }
    9. },
    10. "portMappings": [
    11. { "hostPort": 80, "containerPort": 80, "protocol": "tcp"}
    12. ],
    13. "instances": 1,
    14. "cpus": 0.1,
    15. "mem": 64
    16. }
  2. Add your app to Marathon:

    1. dcos marathon app add <my-app.json>

    If this is added successfully, there is no output.

  3. Verify that the app has been added with this command:

    1. dcos marathon app list

    The output should look like this:

    1. ID MEM CPUS TASKS HEALTH DEPLOYMENT CONTAINER CMD
    2. /myApp 64 0.1 0/1 --- scale DOCKER None

Parent command

CommandDescription
dcos marathonDeploy and manage applications to DC/OS.