hello_world.rst 1.2 KB

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