Skip to main content

Module context

Module context 

Source
Expand description

A task’s build context, and reading one from a directory (#221, IMAGE-7).

Structs§

BuildContext
A build context: the files beside the Dockerfile in the artifact, sorted by name.
ContextEntry
One file of a build context: its path relative to the context root, its mode, and its bytes.
IgnoreRules
The patterns of a .dockerignore file, applied the way Docker applies them.

Constants§

DAEMON_ENTRY
The artifact’s daemon entry, which no context file may take.
DOCKERFILE_ENTRY
The artifact’s Dockerfile entry, which the caller’s Dockerfile fills.
IGNORE_FILES
The ignore files, in precedence order.
MAX_CONTEXT_BYTES
S3’s maximum object size for a single PutObject, 5 GiB, which is how the artifact is uploaded. A context bigger than that cannot be uploaded at all, so it is refused while it is read rather than after it is zipped in memory.

Functions§

from_dir
Reads dir as a build context: every regular file its ignore rules leave in, with the root Dockerfile and ignore files left out and symlinks skipped with a warning.
glob_match
Whether path matches the .dockerignore glob pattern, taken as written (already cleaned). A malformed pattern matches nothing.