ch-build1
Build an image and place it in the builder's back-end storage
Usage
$ ch-build [-b BUILDER] [--builder-info] -t TAG [ARGS ...] CONTEXT
Overview
Build an image named TAG described by a Dockerfile. Place the result into the builder’s back-end storage.
Using this script is not required for a working Charliecloud image. You can also use any builder that can produce a Linux filesystem tree directly, whether or not it is in the list below. However, this script hides the vagaries of making the supported builders work smoothly with Charliecloud and adds some conveniences (e.g., pass HTTP proxy environment variables to the build environment if the builder doesn’t do this by default).
Supported builders, unprivileged:
- •
-
buildah: Buildah in “rootless” mode with no setuid helpers, usingch-run(viach-run-oci) for RUN instructions. This requires Buildah v1.10.1+; see the install instructions.
- •
-
ch-image: Our internal builder.
Supported builders, privileged:
- •
-
buildah-runc: Buildah in “rootless” mode with setuid helpers, using the defaultruncfor RUN instructions.
- •
-
buildah-setuid: Buildah in “rootless” mode with setuid helpers, usingch-run(viach-run-oci) for RUN instructions.
- •
-
docker: Docker.
Specifying the builder, in descending order of priority:
-
-b, --builder BUILDER -
Command line option.
|
Environment variable |
|---|---|
|
|
Other arguments:
-
--builder-info -
Print the builder to be used and its version, then exit.
-
-f, --file DOCKERFILE -
Dockerfile to use (default:
$CONTEXT/Dockerfile)
-
-t TAG -
Name (tag) of Docker image to build.
-
--help -
Print help and exit.
-
--version -
Print version and exit.
Additional arguments are accepted and passed unchanged to the underlying builder.
Examples
Create an image tagged foo and specified by the file Dockerfile located in the context directory. Use /bar as the Docker context directory. Use the default builder.
$ ch-build -t foo /bar
Equivalent to above:
$ ch-build -t foo --file=/bar/Dockerfile /bar
Instead, use /bar/Dockerfile.baz:
$ ch-build -t foo --file=/bar/Dockerfile.baz /bar
Equivalent to the first example, but use ch-image even if Docker is installed:
$ ch-build -b ch-image -t foo /bar
Equivalent to above:
$ export CH_BUILDER=ch-image$ ch-build -t foo /bar
Releases
2 releases since Debian 10 (Buster); the text changed 1 time.
--builder since Debian 11 (Bullseye);
--builder-info since Debian 11 (Bullseye);
-b since Debian 11 (Bullseye);
-f since Debian 11 (Bullseye).