Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing 'Docker Run' Options to Mesos/Marathon/Chronos #859

Open
alanhughes opened this issue Oct 2, 2017 · 0 comments
Open

Passing 'Docker Run' Options to Mesos/Marathon/Chronos #859

alanhughes opened this issue Oct 2, 2017 · 0 comments

Comments

@alanhughes
Copy link

alanhughes commented Oct 2, 2017

I am trying to run my containers in mesos and outputting all logs to Cloudwatch. According to Docker documentation, I should pass the following to 'docker run':

--log-driver=awslogs --log-opt awslogs-region=us-east-1 --log-opt awslogs-group=myLogGroup
(from https://docs.docker.com/engine/admin/logging/awslogs/#awslogs-region)

to docker run. In order to achieve this using Marathon (or Chronos, I assume?) , I should add the following block to my configuration json file for my task


            "parameters": [
            { "key": "hostname", "value": "a.corp.org" },
            { "key": "volumes-from", "value": "another-container" },
            { "key": "lxc-conf", "value": "..." }
        ]

https://mesosphere.github.io/marathon/docs/native-docker.html

It appears that this config appends the following to your docker run

--{key}={value}
Since I need to do something of the form "--log-opt awslogs-region=us-east-1", I am putting "key": "log-opt awslogs-region", "value": "us-east-1", which generates the docker run command correctly, as I can see from stderr in mesos. However, I then get an error saying

See 'docker run --help'.```
Running the generated docker run command from stderr directly on the mesos slave works fine.

```# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)```

Mesos Version: 1.1.0

Chronos container: mesosphere/chronos:v3.0.1

java -jar /chronos/chronos.jar --master zk://xx.xx.xx.xx:2181/mesos --zk_hosts zk://xx.xx.xx.xx:2181 --cluster_name aws --hostname XXXXXXXX --mail_server XXXXXXXX --mail_user XXXXXXXX --mail_passwordXXXXXXXX --mail_from XXXXXXXX --http_port XXXXXXXX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant