title: installing mongodb in a docker container
body: <p>I am trying to create a docker image for mongodb. I am followed the installation instructions from the official mongodb installation to the letter without success. I have tried every single blog and installation instruction out there but without any success. Any help will be greatly appreciated. </p>
  
  <p>My dockerfile contents :</p>
  
  <pre><code>FROM ubuntu:16.04
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
  RUN echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu/ xenial/mongodb-org/3.4 multiverse" |  tee /etc/apt/sources.list.d/mongodb-3.4.list
  
  RUN apt-get update &amp;&amp; apt-get install -y mongodb-org
  RUN mkdir -p /data/db
  RUN chown -R mongodb:mongodb /data/db
  ADD mongodb.conf /etc/mongodb.conf
  ADD mongodb.pem /etc/ssl/certs/mongodb.pem
  
  VOLUME ["/data/db"]
  EXPOSE 27017
  ENTRYPOINT ["/usr/bin/mongod", "--config", "/etc/mongodb.conf"]
  </code></pre>
  
  <p>I am using the follwing command :</p>
  
  <pre><code>sudo docker image build -t mongodb .
  </code></pre>
  
  <p>Everytime I am trying to build the image, I get the following:</p>
  
  <pre><code>Sending build context to Docker daemon   7.68kB
  Step 1/11 : FROM ubuntu:16.04
   ---&gt; 14f60031763d
  Step 2/11 : RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
   ---&gt; Using cache
   ---&gt; 97a851663e60
  Step 3/11 : RUN echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu/ xenial/mongodb-org/3.4 multiverse" |  tee /etc/apt/sources.list.d/mongodb-3.4.list
   ---&gt; Using cache
   ---&gt; 122a2fad0021
  Step 4/11 : RUN apt-get update &amp;&amp; apt-get install -y mongodb-org
   ---&gt; Running in 014e7918e156
  Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
  Ign:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
  Get:3 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
  Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
  Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
  Get:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3457 B]
  Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
  Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [42.0 kB]
  Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [394 kB]
  Get:10 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.8 kB]
  Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [184 kB]
  Get:12 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [2931 B]
  Get:13 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
  Get:14 http://alert.scansafe.net/alert/process?a=-3-BW4R_eLtf_R7PUTnlOeb6kHjw5kMPDH4n_j9vuji99G7a0CHJtXpeYpzGHZPC0wRr52uECxiceRo23F5y5nJqQ&amp;b=iDw6Hli7TPC7hodjxRcdBj9i1UevoPI4aXCTkM2htEe16EENN3K7sUkicBLWMmbvQJHy5RccSqbLlHU4Q23W8w7vzekV399jAw6NbyJsJBJPm_U3VdYSosJyHFldLABeOaw16L56ass0uQ-KDLgyWadENbyoiMwzO-1nwE6QYwf1NcLI1073TBf9mObvKXGE7lL2-OpA1MA6dI2cdh6AETyP3g0OipJUm4fag2-7TI5j_BImQOsvvEVlzZ7ilSFaUVOlMbWBWuuU822y_f0ph82C3dG_kBenckmPWso5ln9ShKoiCmjbcSZjT76_j3Hwh3nSYYv1AqX8Kj8gFD4k1MI2Li7WNMs9rnq4vUa9eeaN_ivffMClQHK6I88vPaR4FQr61U5ecOwl0KmVyhP3FLDF-4KpOGg3Kf7kVRCnLpQZwXnsrrTt3enSpjn66IzlCgG3PmNrVhdqOTBQFh5PfWtgdGG68Ir6hZIBt170nqGSMhgFmlTMTMbO5EGkA-uyPz8worv7RSc&amp;blockedUrl=http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages [5870 B]
  Err:14 http://alert.scansafe.net/alert/process?a=-3-BW4R_eLtf_R7PUTnlOeb6kHjw5kMPDH4n_j9vuji99G7a0CHJtXpeYpzGHZPC0wRr52uECxiceRo23F5y5nJqQ&amp;b=iDw6Hli7TPC7hodjxRcdBj9i1UevoPI4aXCTkM2htEe16EENN3K7sUkicBLWMmbvQJHy5RccSqbLlHU4Q23W8w7vzekV399jAw6NbyJsJBJPm_U3VdYSosJyHFldLABeOaw16L56ass0uQ-KDLgyWadENbyoiMwzO-1nwE6QYwf1NcLI1073TBf9mObvKXGE7lL2-OpA1MA6dI2cdh6AETyP3g0OipJUm4fag2-7TI5j_BImQOsvvEVlzZ7ilSFaUVOlMbWBWuuU822y_f0ph82C3dG_kBenckmPWso5ln9ShKoiCmjbcSZjT76_j3Hwh3nSYYv1AqX8Kj8gFD4k1MI2Li7WNMs9rnq4vUa9eeaN_ivffMClQHK6I88vPaR4FQr61U5ecOwl0KmVyhP3FLDF-4KpOGg3Kf7kVRCnLpQZwXnsrrTt3enSpjn66IzlCgG3PmNrVhdqOTBQFh5PfWtgdGG68Ir6hZIBt170nqGSMhgFmlTMTMbO5EGkA-uyPz8worv7RSc&amp;blockedUrl=http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4/multiverse amd64 Packages
    Hash Sum mismatch
  Get:15 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
  Get:16 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
  Get:17 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
  Get:18 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
  Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [208 kB]
  Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [756 kB]
  Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.3 kB]
  Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [645 kB]
  Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [17.5 kB]
  Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4930 B]
  Get:25 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [6237 B]
  Fetched 24.2 MB in 7s (3158 kB/s)
  Reading package lists...
  E: Failed to fetch http://alert.scansafe.net/alert/process?a=-3-BW4R_eLtf_R7PUTnlOeb6kHjw5kMPDH4n_j9vuji99G7a0CHJtXpeYpzGHZPC0wRr52uECxiceRo23F5y5nJqQ&amp;b=iDw6Hli7TPC7hodjxRcdBj9i1UevoPI4aXCTkM2htEe16EENN3K7sUkicBLWMmbvQJHy5RccSqbLlHU4Q23W8w7vzekV399jAw6NbyJsJBJPm_U3VdYSosJyHFldLABeOaw16L56ass0uQ-KDLgyWadENbyoiMwzO-1nwE6QYwf1NcLI1073TBf9mObvKXGE7lL2-OpA1MA6dI2cdh6AETyP3g0OipJUm4fag2-7TI5j_BImQOsvvEVlzZ7ilSFaUVOlMbWBWuuU822y_f0ph82C3dG_kBenckmPWso5ln9ShKoiCmjbcSZjT76_j3Hwh3nSYYv1AqX8Kj8gFD4k1MI2Li7WNMs9rnq4vUa9eeaN_ivffMClQHK6I88vPaR4FQr61U5ecOwl0KmVyhP3FLDF-4KpOGg3Kf7kVRCnLpQZwXnsrrTt3enSpjn66IzlCgG3PmNrVhdqOTBQFh5PfWtgdGG68Ir6hZIBt170nqGSMhgFmlTMTMbO5EGkA-uyPz8worv7RSc&amp;blockedUrl=http://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.4/multiverse/binary-amd64/Packages.gz     Hash Sum mismatch
  E: Some index files failed to download. They have been ignored, or old ones used instead.
  The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y mongodb-org' returned a non-zero code: 100
  </code></pre>