If you run the wordpress container on a different host to the mysql container and use --link on the command line, does that work?
-- Aaron Carey Production Engineer - Cloud Pipeline Industrial Light & Magic London 020 3751 9150 ________________________________ From: Stefano Bianchi [[email protected]] Sent: 26 April 2016 16:23 To: [email protected] Subject: RE: Launch docker container from Marathon UI Hi Aaron Actually both mesos-dns and calico are running even though these containers im running are not, yet, using the calico ipaddr specific in json description. So i guess it is a problem of bridging, i guess simply specify HOST option on container field in Marathon UI Il 26/apr/2016 16:59, "Aaron Carey" <[email protected]<mailto:[email protected]>> ha scritto: --link in docker should really be avoided when using marathon/mesos as it implies the containers are on the same host, but this will not always be the case when mesos schedules your containers (also I think it's being deprecated in docker anyway.. not sure though?). This problem looks like one of service discovery within the mesos cluster: how does one service contact the other when it doesn't know which host the other service may have landed on? There are several different solutions for service discovery, you can look into some like Project Calico to offer a network layer to docker or try dns based solutions like Mesos-dns or Consul (along with mesos-consul). I think marathon also has some concept of service discovery built in too if you use something like haproxy. I hope this helps! Aaron -- Aaron Carey Production Engineer - Cloud Pipeline Industrial Light & Magic London 020 3751 9150 ________________________________ From: June Taylor [[email protected]<mailto:[email protected]>] Sent: 26 April 2016 15:22 To: [email protected]<mailto:[email protected]> Subject: Re: Launch docker container from Marathon UI Stefano, The docker run flag --link is intended to connect the container to another running container. I do not know how this would operate in marathon. Perhaps it would be an application group which starts up the mysql docker image first, then the Wordpress docker image after it. Thanks, June Taylor System Administrator, Minnesota Population Center University of Minnesota On Tue, Apr 26, 2016 at 9:20 AM, Stefano Bianchi <[email protected]<mailto:[email protected]>> wrote: Thanks Rad Gruchalski, actually i'm trying to make a json file that "translate" this command in marathon: docker run --name some-wordpress --link some-mysql:mysql -d wordpress i guess the error is relate to the fact that i'm not specifying --link some-mysql:mysql My problem is that i don't know how to do that, i tried to fill environment variable fields: Key = link Value = some-mysql:mysql But in this way the app does not work as well. How can i configure these env variables? 2016-04-26 16:01 GMT+02:00 Rad Gruchalski <[email protected]<mailto:[email protected]>>: It says exactly what the problem is. Start a marathon task with correct environment variables in env and you will be fine. Best regards, Radek Gruchalski [email protected]<mailto:[email protected]> <mailto:[email protected]> de.linkedin.com/in/radgruchalski/<http://de.linkedin.com/in/radgruchalski/> Confidentiality: This communication is intended for the above-named person and may be confidential and/or legally privileged. If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately. On Tuesday, 26 April 2016 at 15:56, Stefano Bianchi wrote: jupyter is working fine. i tried to run wordpress and i get this error in stderr of mesos: error: missing WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP environment variables Did you forget to --link some_mysql_container:mysql or set an external db with -e WORDPRESS_DB_HOST=hostname:port? Some one of you know this issue? 2016-04-26 15:51 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: However thank you so much to all! 2016-04-26 15:22 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: i found the answer by my self sorry if i disturbed you. 2016-04-26 15:19 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: Now that it is running, how can i check the User Interface? 2016-04-26 15:18 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: Yes, now it's running!!! June you are awesome!!! 2016-04-26 15:16 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: i have done these 2 commands, now jupyter is in deploying in marathon, staging in mesos. Is there some additional configuration needed? 2016-04-26 15:13 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: June i tried to run your json, but the task is waiting, and if starts it failed immediately. I guess because i did not type this commands: 1. echo 'docker,mesos' > /etc/mesos-slave/containerizers 2. $ echo '5mins' > /etc/mesos-slave/executor_registration_timeout Could it be the problem? 2016-04-26 15:02 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: Thank you June taylor, it is axactly what i was intending. if it is not disturbing you, i try jupyter notebook as well, just to make some tests on how to launch marathon. stay tuned :) 2016-04-26 14:58 GMT+02:00 Stefano Bianchi <[email protected]<mailto:[email protected]>>: thanks haosdent. actually i have run this kind of apps through rest api. Now i want learn how to laung docker files. I found this exaple: { "container": { "type": "DOCKER", "docker": { "network": "HOST", "image": "group/image" }, "volumes": [ { "containerPath": "/etc/a", "hostPath": "/var/data/a", "mode": "RO" }, { "containerPath": "/etc/b", "hostPath": "/var/data/b", "mode": "RW" } ] } } I am able to link the correspondent field in the marathon UI with what is written in this json. What i need to understand is, what i should write in: "image": "group/image" i mean, with what i have to replace group and image? For instance, if i would run wordpress container on docker hub what i should put replacing "group/image" ? 2016-04-26 14:30 GMT+02:00 haosdent <[email protected]<mailto:[email protected]>>: This is marathon REST API document: https://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps . Usually we define a task json file and call the rest api. For example, create tasks.json which content is ``` { "id": "/test-sleep", "cmd": "sleep 200" } ``` And ``` curl -X POST -H "Content-type: application/json" http://${YOUR_MARATHON_ADDR}:8080/v2/apps -d @tasks.json ``` You could find more field definitions in their document. On Tue, Apr 26, 2016 at 8:24 PM, Stefano Bianchi <[email protected]<mailto:[email protected]>> wrote: Hi guys i'm trying to follow the instructions on mesosphere documentation, but it is a little bit unlear for me that i am new to this world. i' would like to launch a wordpress container, present on docker hub here https://hub.docker.com/_/wordpress/ , from marathon UI but i don't understand the mechanism. I understood that i don't have to specify a command in "Command" field, but i don't know how to fill the dockers fields in marathon UI to launch wordpress container. Could you please help me or tell me where i can find a clearer documentation? Thanks. -- Best Regards, Haosdent Huang

