Run a Docker Image as a Container

I built a docker image from a dockerfile. I see the image was built successfully, but what do I do with it? Shouldn’t it be able to run as a container?

New to docker so probably a misunderstanding on my end, any help would be great.

  • Docker container failing to install mongo
  • Communicating between a windows and linux docker container on the same host
  • Send logs to web page with node.js
  • DNS Server in Docker Container
  • Can't resolve docker related sbt tags
  • My docker container was created with no name and no tag
  • Is it possible to create image from file on docker host using docker API?
  • Docker Swarm, Compose and PostgreSQL
  • Docker separation of processes and source code control
  • Connecting to a remote MySQL database from Docker container
  • docker root crontab job not executing
  • cant enter the phpmyadmin docker
  • 3 Solutions collect form web for “Run a Docker Image as a Container”

    The specific way to run it depends on whether you gave the image a tag/name or not.

    $ docker images
    root@dockertest:~# docker images
    REPOSITORY          TAG                 ID                  CREATED             SIZE
    ubuntu              12.04               8dbd9e392a96        4 months ago        131.5 MB (virtual 131.5 MB)

    With a name (let’s use ubuntu):

    $ docker run -i -t ubuntu:12.04 /bin/bash

    Without a name, just using the ID:

    $ docker run -i -t 8dbd9e392a96 /bin/bash

    Please see for more information.

    Do following steps :

    1. $ docker images

      you will get list of all local docker images with tags specified.

    2. $ docker run image_name:tag_name

      If you didn’t specify tag_name it will automatically run image with ‘latest’ tag.

      Instead of image_name you can also specify Image Id (no tag_name).

    Here is an example to run a webdev service in docker.
    The image’s name is morrisjobke/webdav. You can pull it from dockerhub.

    After you run this images,you can then access the WebDAV instance at http://localhost:8888/webdav. Internally the folder /var/webdav is used as WebDAV root.

    You can run this container in following way:

    $ docker run -d -e USERNAME=test -e PASSWORD=test -p 8888:80 morrisjobke/webdav

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