Building the MongoDB Docker image

Following this docker example to build and run a mongo db image.
But not able to build the image.

sudo docker build --tag himanshuy/repo

Usage: docker build [OPTIONS] PATH | URL | -

Build a new image from the source code at PATH

  --force-rm=false     Always remove intermediate containers, even after unsuccessful builds
  --no-cache=false     Do not use cache when building the image
  --pull=false         Always attempt to pull a newer version of the image
  -q, --quiet=false    Suppress the verbose output generated by the containers
  --rm=true            Remove intermediate containers after a successful build
  -t, --tag=""         Repository name (and optionally a tag) to

  • unable to run a container with volume on glusterfs
  • getting permission denied in docker run
  • chown in docker not changing user to root
  • Deleting all Docker images from a repository
  • install and Run Kurento Media server in Cent OS 6.6 using Docker
  • How to create a service on the bridge network and the host network?
  • Connecting to Redis running in Docker Container from Host machine
  • CentOS 7.0 docker fail to start service
  • Running docker chrome node in EC2 Does Not Download Files
  • Starting mongo through docker on a Synology NAS
  • How can I debug my docker container with docker-machine and PHPStorm
  • “certificate verify failed” when connecting docker-compose to IBM Container Cloud
  • One Solution collect form web for “Building the MongoDB Docker image”

    Try specifying the path to your Dockerfile (use . if you already are in that folder) and using = with --tag or without it if you use -t; so:
    sudo docker build -t himanshuy/repo . or
    sudo docker build --tag=himanshuy/repo .

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.