A MongoDB Dockerfile to spin up a mongodb container.
This image is available as a trusted build on the docker index. The easiest way to get it on your server is using docker pull:
.. code-block:: bash
$ docker pull swcc/docker-mongodb
Alternatively, you can clone this repository and build the image yourself:
.. code-block:: bash
$ docker build -t=swcc/docker-mongodb .
After building/retrieving the Docker container:
.. code-block:: bash
# Run the docker container
docker run -p 27017:27017 -name mongodb -d swcc/docker-mongodb /sbin/my_init --enable-insecure-key # Give container a name in case it's linked to another app container
docker run - starts a new docker container
-p 27017:27017 - Optionnal: binds the local port 27017 to the container's port 27017, so a local.-d swcc/docker-mongodb - Use the image tagged "swcc/docker-mongodb" if you need to link it to another container for instance.-name mongodb - Give it a name to easily linked it to another container./sbin/my_init - Run the init scripts used to kick off long-running processes and other bootstrapping, as per phusion/baseimage-docker--enable-insecure-key - Enable a generated SSL key so you can SSH into the container, again as per phusion/baseimage-docker. Generate your own SSH key for production use.-name mongodb will allow you to link it with the web-app.Content type
Image
Digest
sha256:32a984084…
Size
271 MB
Last updated
almost 11 years ago
docker pull swcc/docker-mongodb