Docker when deployed on marathon is failing continously

I am new to these technologies and trying to figure things out. So, I followed the basic tutorials provided by Mesosphere and was able to create a cluster locally (two VMs) now I want to deploy a nodejs application so I created a docker image which contains nodejs express framework and a script which just start the server. You can find the docker image at docker registry as pujariamol/nodejs-express and it has a script at root level called as

The JSON that I tried for deploying it is as follows:

  • Why will my Nginx docker container not start when the --restart switch is specified
  • Cannot connect to Docker daemon in Azure Container Service
  • Get docker container id from container name
  • How to pass run options to docker-compose
  • Dockerfile created for JBoss with MySQL image
  • DC/OS JMX Access
  • {
        "id": "app4", 
        "container": {
          "docker": {
            "image": "pujariamol/nodejs-express"
        "cmd":"echo hello > /tmp/out.txt",
        "cpus": 0.25,
        "mem": 512.0,
        "instances": 1

    I thought this will pull my docker container and will start it. Also, I wanted to run so I was trying ‘./’ in cmd but it didn’t work so I tried writing some text in out.txt for testing purpose but nothing seems to work. The moment the application is deployed the mesos shows Failed status for this app.
    I am using chrome extension postman for deploying it on marathon.
    I have no idea what is going wrong. Please help me with getting this application deployed on Marathon and let me know if you need any more information.

    Thanks in advance.

  • Docker: build with different results compared to manual step-by-step build
  • how to install global angular-cli inside docker container?
  • Installing rbenv on docker ubuntu/debian
  • Setup local Wordpress development environment with Docker error 500
  • Start service automatic inside Docker container
  • How can I make my Docker compose “wait-for-it” script invoke the original container ENTRYPOINT or CMD?
  • 2 Solutions collect form web for “Docker when deployed on marathon is failing continously”

    I don’t know Mesosphere at all, but if you are trying to run this in a container:

    echo hello > /tmp/out.txt

    …then your container is going to be very, very short lived. A Docker container only runs as long as your initial command, and echo is simply going to exit immediately.

    Are you able to start the container successfully using docker run by itself, without involving mesosphere? Have you looked at the container logs to see if there are any useful errors? You can use docker logs for this, and it’s possible that Mesosphere provides an interface to this information.

    If you are trying to run ./, are you certain that there is a script named in the current directory when the container starts? It would have to be located in the root directory (/) for this to work. It’s generally better to provide a full path to your initial command (e.g., /, or /usr/local/something/

    Thank you Larsks for the reply.
    Yes I checked the container and scripts individually they were working fine. Though it is working now, I am not sure if this is the reason. So, I assume it was happening because I was running the container on my virtual machine and I was creating a job from a postman which was on my host machine (Windows8) and it never worked for So, I tried it from within the VM using CURL cmd and it worked and I can access the container server too just that I have to find out the container IP address and then try to access it. So now will be trying to figure out how to access these servers from a single URL.
    Anyway thank you Larsks, I didn’t know that the containers will be short lived for such commands before I read your comment.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.