AAtsushi's Blog
Infrastructure

Docker Build Context

→ 日本語版を読む

Build context

Local context

The first build you learn is probably docker build .. This is called a "Local context". Docker references and incorporates the current directory ..

local_context

Building from standard input/output or from a tar file is also included under Local context.

Remote context

Builds by referencing Git's HEAD. The builder clones the latest commit on the default branch of the repository by default.

docker build https://github.com/user/myrepo.git

For private repositories, SSH or token-based authentication credentials are required.

Empty context

If the Dockerfile does not depend on local files, you can build with an Empty context.

  • Unix pipe
  docker build - < Dockerfile

  • PowerShell
  Get-Content Dockerfile | docker build -

References

Build context