How to launch a Docker container that i've got from another person?

I am a Docker-newbie and I’ve got a project from another developer including a Dockerfile. This shall give me the Virtual Machine to continue work with the (nodeJS-) project inside this project folder.

Docker is already installed on my machine.
How can I launch this container now?

  • AWS ECS container exiting without specific reason
  • How to set a time limit for a Kubernetes job?
  • How to open port for docker container?
  • Are Dockerfiles stored on my machine?
  • TravisCI Docker Permissions
  • Kubernetes configuration to link containers
  • I’ve read about a command

    sudo docker run -name my_first_instance

    but i can’t find any container name in the Dockerfile.

  • Using docker-compose in order to create a MySQL schema/database
  • Docker logs not showing colors (express + nodejs image)
  • Should I stop a container before commit it?
  • Connectivity issue to Cassandra cluster from Docker container (Java)
  • Change docker container username
  • Two docker container need volumes from each other
  • 2 Solutions collect form web for “How to launch a Docker container that i've got from another person?”

    The dockerfile will create an image for you that you can launch containers from. this being said , Follow this:

    Create a folder.

    Copy dockerfile in the folder

    cd into the folder execute the following command:

    docker build -t <your desired image name> .

    This will create an image using directives in the dockerfile in the current folder.

    Now launch a container from the image.

    docker run -d --name <your container name> <imagename from previous step> <optional startup commands>

    Useful docker commands:

    You can expose ports in the previous command using -p switch.

    You can list Images via docker images

    You can list running containers via docker ps

    you can list running + exited containers via docker ps -a

    have a look at

    it is the official repository for NodeJS docker images

    If you want some docker images based on NodeJS, you will need to pull them docker pull my_node_image

    Then you can launch one with such a command

    docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:4 node your-daemon-or-script.js

    The Dockerfile is just the recipe to build a docker image, for Nginx, Mysql, MongoDb, Redis, WordPress, Spotify, atop, htop…

    If docker images shows nothing, it means you have not yet pulled any docker image.

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