ch-build - Build an image and place it in the builder's back-end storage
Contents
Bugs
The tag suffix :latest is somewhat misleading, as by default neither ch-build nor bare builders will
notice if the base FROM image has been updated. Use --pull to make sure you have the latest base image.
Copyright
2014–2021, Triad National Security, LLC
0.26 2022-01-30 10:06 UTC CH-BUILD(1)
Description
WARNING:
This script is deprecated in favor of using the desired builder directly; we have added some tips for
Docker to the FAQ. It will be removed in the next release.
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:
• ch-image: Our internal builder.
Supported builders, privileged:
• docker: Docker.
Experimental builders (i.e., the code is there but not tested much):
• buildah: Buildah in “rootless” mode with no setuid helpers, using ch-run (via ch-run-oci) for RUN
instructions. This mode is fully unprivileged.
• buildah-runc: Buildah in “rootless” mode with setuid helpers, using the default runc for RUN
instructions.
• buildah-setuid: Buildah in “rootless” mode with setuid helpers, using ch-run (via ch-run-oci) for
RUN instructions.
Specifying the builder, in descending order of priority:
-b,--builderBUILDER
Command line option.
$CH_BUILDER
Environment variable
Defaultdocker if Docker is installed; otherwise, ch-image.
Other arguments:
--builder-info
Print the builder to be used and its version, then exit.
-f,--fileDOCKERFILE
Dockerfile to use (default: $CONTEXT/Dockerfile)
-tTAG 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
Name
ch-build - Build an image and place it in the builder's back-end storage
Reporting Bugs
If Charliecloud was obtained from your Linux distribution, use your distribution’s bug reporting
procedures.
Otherwise, report bugs to: https://github.com/hpc/charliecloud/issuesSee Also
charliecloud(7)
Full documentation at: <https://hpc.github.io/charliecloud>
Synopsis
$ ch-build [-b BUILDER] [--builder-info] -t TAG [ARGS ...] CONTEXT
