1CH-BUILD(1) Charliecloud CH-BUILD(1)
2
3
4
6 ch-build - Build an image and place it in the builder's back-end stor‐
7 age
8
10 $ ch-build [-b BUILDER] [--builder-info] -t TAG [ARGS ...] CONTEXT
11
13 Build an image named TAG described by a Dockerfile. Place the result
14 into the builder’s back-end storage.
15
16 Using this script is not required for a working Charliecloud image. You
17 can also use any builder that can produce a Linux filesystem tree di‐
18 rectly, whether or not it is in the list below. However, this script
19 hides the vagaries of making the supported builders work smoothly with
20 Charliecloud and adds some conveniences (e.g., pass HTTP proxy environ‐
21 ment variables to the build environment if the builder doesn’t do this
22 by default).
23
24 Supported builders, unprivileged:
25
26 • ch-image: Our internal builder.
27
28 Supported builders, privileged:
29
30 • docker: Docker.
31
32 Experimental builders (i.e., the code is there but not tested much):
33
34 • buildah: Buildah in “rootless” mode with no setuid helpers, using
35 ch-run (via ch-run-oci) for RUN instructions. This mode is fully
36 unprivileged.
37
38 • buildah-runc: Buildah in “rootless” mode with setuid helpers, us‐
39 ing the default runc for RUN instructions.
40
41 • buildah-setuid: Buildah in “rootless” mode with setuid helpers,
42 using ch-run (via ch-run-oci) for RUN instructions.
43
44 Specifying the builder, in descending order of priority:
45
46 -b, --builder BUILDER
47 Command line option.
48
49 $CH_BUILDER
50 Environment variable
51
52 Default
53 docker if Docker is installed; otherwise, ch-image.
54
55 Other arguments:
56
57 --builder-info
58 Print the builder to be used and its version, then exit.
59
60 -f, --file DOCKERFILE
61 Dockerfile to use (default: $CONTEXT/Dockerfile)
62
63 -t TAG Name (tag) of Docker image to build.
64
65 --help Print help and exit.
66
67 --version
68 Print version and exit.
69
70 Additional arguments are accepted and passed unchanged to the underly‐
71 ing builder.
72
74 The tag suffix :latest is somewhat misleading, as by default neither
75 ch-build nor bare builders will notice if the base FROM image has been
76 updated. Use --pull to make sure you have the latest base image.
77
79 Create an image tagged foo and specified by the file Dockerfile located
80 in the context directory. Use /bar as the Docker context directory. Use
81 the default builder.
82
83 $ ch-build -t foo /bar
84
85 Equivalent to above:
86
87 $ ch-build -t foo --file=/bar/Dockerfile /bar
88
89 Instead, use /bar/Dockerfile.baz:
90
91 $ ch-build -t foo --file=/bar/Dockerfile.baz /bar
92
93 Equivalent to the first example, but use ch-image even if Docker is in‐
94 stalled:
95
96 $ ch-build -b ch-image -t foo /bar
97
98 Equivalent to above:
99
100 $ export CH_BUILDER=ch-image
101 $ ch-build -t foo /bar
102
104 If Charliecloud was obtained from your Linux distribution, use your
105 distribution’s bug reporting procedures.
106
107 Otherwise, report bugs to: <https://github.com/hpc/charliecloud/issues>
108
110 charliecloud(7)
111
112 Full documentation at: <https://hpc.github.io/charliecloud>
113
115 2014–2021, Triad National Security, LLC
116
117
118
119
1200.25 2021-09-20 00:00 UTC CH-BUILD(1)