title: Correct syntax to do mongodump of mongoDb docker instance?
body: <p>I'm running an ubuntu 16.04 LTS server with some docker container. One of these containers is a mongoDB container, where my data is stored.
  Now I'm trying to make a backup by <code>mongodump</code>. 
  The problem for me is, that mongoDb is running as a docker container, and the backup should be stored outside of the docker container.</p>
  
  <p>I think the syntax for this is something like this:</p>
  
  <pre><code>docker run \
    --rm \
    -it \
    --link DOCKER_CONTAINER_NAME:mongo_alias \
    -v /backup:/backup \
    mongo mongodump \
    --host mongo_alias \
    --out /backup/
  </code></pre>
  
  <p>But I'm not sure for the parameters I have to use...</p>
  
  <p>This is what I get for my mongoDb container via <code>docker ps</code>:</p>
  
  <pre><code>7bee41bfa08a  mongo:3.4  "docker-entrypoint..."   4 months ago   Up 2 months   27017/tcp   mongo_db
  </code></pre>
  
  <p>And this is my docker-compose file:</p>
  
  <pre><code>version: "3"
  services:
    mongo_db:
      container_name: mongo_db
      image: 'mongo:3.4'
      restart: 'always'
      volumes:
        - '/opt/mongo/project/live:/data/db'
  </code></pre>
  
  <p>So it should look like this?</p>
  
  <pre><code>docker run \
    --rm \
    -it \
    --link mongo_db:mongo_alias \ # mongo_alias can be choosen freely?
    -v /backup:/backup \          # Don't understand /backup:/backup
    mongo mongodump \
    --host mongo_alias \
    --out /backup/                # This is in the root of the server?
  </code></pre>