build.rst 818 B

123456789101112131415161718192021222324252627282930
  1. :title: Build Command
  2. :description: Build a new image from the Dockerfile passed via stdin
  3. :keywords: build, docker, container, documentation
  4. ================================================
  5. ``build`` -- Build a container from a Dockerfile
  6. ================================================
  7. ::
  8. Usage: docker build [OPTIONS] PATH | URL | -
  9. Build a new container image from the source code at PATH
  10. -t="": Tag to be applied to the resulting image in case of success.
  11. When a single Dockerfile is given as URL, then no context is set. When a git reppository is set as URL, the repository is used as context
  12. Examples
  13. --------
  14. .. code-block:: bash
  15. docker build .
  16. This will take the local Dockerfile
  17. .. code-block:: bash
  18. docker build -
  19. This will read a Dockerfile form Stdin without context