title: Mongorestore in docker failed: Failed: gzip: invalid header
body: <p>I created a mongo dump with commands (as suggested in <a href="https://stackoverflow.com/a/17655910/4282333">this answer</a>)</p>
  
  <pre><code>docker exec -it mongodb bash
  mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive &gt; dumpname.gz
  </code></pre>
  
  <p>Now when I'm trying to restore the dump with</p>
  
  <pre><code>docker exec mongodb bash -c 'mongorestore --gzip --archive=dumpname.gz'
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p>Failed: gzip: invalid header</p>
  </blockquote>