Wojciech Sielski created MESOS-3377:
---------------------------------------

             Summary: mesos docker container with container_name as ENV variable
                 Key: MESOS-3377
                 URL: https://issues.apache.org/jira/browse/MESOS-3377
             Project: Mesos
          Issue Type: Wish
          Components: docker
    Affects Versions: 0.25.0
            Reporter: Wojciech Sielski
            Priority: Minor


1. Long story short:

We have mesos and marathon (and other app) based PaaS.
https://github.com/eBayClassifiedsGroup/PanteraS

We use mesos with consul and registrator as a glue app that register in consul 
docker containers.. Some tricky part we have with deregistering container 
BEFORE it is killed, but after SIGTERM is received.

To do that we use bash wrapper script that trap SIGTERM 
https://github.com/eBayClassifiedsGroup/PanteraS/blob/master/frameworks/start.sh#L45
and put container into consul maintenance mode.

Till that part everything works perfectly fine - so when marathon re-deploy 
container it is smoothly taken out from consul (and loadbalancers)

To take service out from consul, we need to know consul service id = which is 
based on mesos container name (this is how registrator do that).

We did kind of easy docker wrapper that inject mesos name as ENV variable:
https://github.com/eBayClassifiedsGroup/PanteraS/blob/master/infrastructure/docker

BUT
Since new mesos release, mesos doesn't use local docker binary, but docker 
socket and API. So our workaround will not work anymore.

2. What we need - our wish :) :
Just injection of docker mesos name as ENV variable.
Since this is the easiest way of getting it, so we can easy deregister it.

ps.
Yes, we know that you can do docker inspect to get that - but this require 
docker application - in smallest container we cannot have it.
Yes, we know that you can get it from docker API (same like inspect)
but much much easier is 12 factor app rule to follow and have it as ENV 
variable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to