MongoDb in Azure Container Instance Fails after some time

I have mongoDB running in Azure Container Instance. DB run constantly and it was OK, but it happens 2 times that container went in Failed state. The Fail state happened in time range of one month. This is my Dockefile:

FROM ubuntu:xenial

# Update the repository sources list
RUN apt-get update && apt-get install -y wget gnupg apt-transport-https ca-certificates vim 

#Import GPG Key from
RUN wget -qO - | apt-key add -

#Create a list file /etc/apt/sources.list.d/mongodb-org-4.2.list for MongoDB
RUN echo "deb [ arch=amd64,arm64 ] xenial/mongodb-org/4.2 multiverse" |  tee /etc/apt/sources.list.d/mongodb-org-4.2.list

#Install the latest stable version of MongoDB
RUN apt-get update && apt-get install -y mongodb-org 
RUN mkdir -p /data/db

# Expose the default port
EXPOSE 27017

CMD ["--port 27017", "--smallfiles"]

# Set default container command and overwrite default address with
ENTRYPOINT usr/bin/mongod --bind_ip

I don't have logs, so I believe it's hard to say what is the cause, but is there some reason why container fails looking on Dockerfile? The DB container must run without interruptions, so this is quite critical issue.

1 answer

  • answered 2020-07-11 03:14 Atul

    I don't see any issue in the dockerfile which you have shared here. However if you have any doubt about dockerfile of mongo, you can use the official mongodb dockerfile (

    In order to actual troubleshoot the problem, you will need to understand what exactly happened with the containers and would needs logs for it.