Docker file for mongo db - mongodb

I created an RDS DB server for Mongo-DB,
which is attached to a web app, I created a Docker file for the respective Docker image & successfully deployed it in Kubernetes Pods.
Now I want to create the Docker image for this MongoDb,
Can any help me how to create a docker file to install Mongo DB & deploy my RDS server in it
Thanks in advance

There is no need to create private image for MongoDB, unless you need very specific settings.
Get the one from Docker Hub. This is the link to the official image

Related

Cannot add postgres container into pgadmin4 container

I'm fairly new to docker and I want to set up a PostgreSQL database and manage it with pgadmin4. Both in docker.
Unfortunately, I cannot add the PostgreSQL database to pgadmin4
I created both containers via portainer and chose the latest docker hub images.
When creating both containers, I chose "bridge" as the network type.
Both containers in portainer
As you might see in this picture, they share the same network and are not isolated from each other.
Are there any additional steps to do?

Cannot access to mongodb from container app

I setting up a project using docker, nodejs and mongodb. Here is my configuration: https://github.com/tuanna2704/docker-express/blob/master/docker-compose.yml
after I run
docker-compose up
And I can access to http://localhost:4000 via my real machine but application cannot access to db container. Im newbie docker. Any one can explain for me reason why? Thanks a lot!
Check mongo client mongodb://localhost:27017/ working status after
docker-compose up in your local machine; If it works, then mongodb://mongo:27017/ should be fine
Better add tags in the image name image: mongo:latest

How to use docker with mongo to achieve replication and with opening authentication

I want to use docker run a vm mongodb, at the same time, the mongo configure file use my own defined configure file to archive replication and open authentication.
Scanning some files but don't resolve the problem.
Any ideas?
The docker mongo image has a docker-entrypoint.sh it calls in the Dockerfile
Check if you can:
create your own image which would create the right user and restart mongo with authentication on: see "umputun/mongo-auth" and its init.sh script
or mount a createUser.js script in docker-entrypoint-initdb.d.
See "how to make a mongo docker container with auth"

Backup Mongo in a Docker container

I have deployed an Mongo image in a Docker container via Docker Cloud. It is linked to a Meteor app. Is there any way to backup the data on the container?
Create another Docker container that runs a script controlled by a cron job that executes the backup and stores it onto a shared volume.
Also see Cron containers for docker - how do they actually work?

How can I connect a docker container in AWS to a RDS

How can I --link a docker container(odoo) running on a plain EC2 instance or via EB to a RDS in AWS? I tried loading a custom config file with the location of the server but that didn't work. In EB I created an app with a postgres DB, successfully deployed my docker.aws.json but I can not connect to web interface of the the application.
When I check the docker logs of the container it says everything started fine but expects the DB on localhost.
So like I said my question is how can I tell a docker container to --link to a RDS and not an other docker container à la --link db:db?
If you created a database in AWS Elastic Beanstalk, you can access it using environment variables that EB set for you. See examples in the documentation: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-rds.html (Python example)
The environment variable containing the RDS DB hostname is called RDS_HOSTNAME. See example: https://github.com/awslabs/eb-demo-php-simple-app/tree/docker-apache
It's not possible to use a link as your RDS DB is not a Docker container.