hello_world.rst 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. :title: Hello world example
  2. :description: A simple hello world example with Docker
  3. :keywords: docker, example, hello world
  4. .. _hello_world:
  5. Hello World
  6. ===========
  7. This is the most basic example available for using Docker. The example assumes you have Docker installed.
  8. Download the base container
  9. .. code-block:: bash
  10. # Download a base image
  11. docker pull base
  12. The *base* image is a minimal *ubuntu* based container, alternatively you can select *busybox*, a bare
  13. minimal linux system. The images are retrieved from the docker repository.
  14. .. code-block:: bash
  15. #run a simple echo command, that will echo hello world back to the console over standard out.
  16. docker run base /bin/echo hello world
  17. **Explanation:**
  18. - **"docker run"** run a command in a new container
  19. - **"base"** is the image we want to run the command inside of.
  20. - **"/bin/echo"** is the command we want to run in the container
  21. - **"hello world"** is the input for the echo command
  22. **Video:**
  23. See the example in action
  24. .. raw:: html
  25. <div style="margin-top:10px;">
  26. <iframe width="560" height="350" src="http://ascii.io/a/2603/raw" frameborder="0"></iframe>
  27. </div>
  28. Continue to the :ref:`hello_world_daemon` example.