github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-farm-build.1.md.in (about) 1 % podman-farm-build 1 2 3 ## NAME 4 podman\-farm\-build - Build images on farm nodes, then bundle them into a manifest list 5 6 ## SYNOPSIS 7 **podman farm build** [*options*] [*context*] 8 9 ## DESCRIPTION 10 **podman farm build** Builds an image on all nodes in a farm and bundles them up into a manifest list. 11 It executes the `podman build` command on the nodes in the farm with the given Containerfile. Once the 12 images are built on all the farm nodes, the images will be pushed to the registry given via the **--tag** 13 flag. Once all the images have been pushed, a manifest list will be created locally and pushed to the registry 14 as well. 15 16 The manifest list will contain an image per native architecture type that is present in the farm. 17 18 The primary function of this command is to create multi-architecture builds that will be faster than doing it 19 via emulation using `podman build --arch --platform`. 20 21 If no farm is specified, the build will be sent out to all the nodes that `podman system connection` knows of. 22 23 Note: Since the images built are directly pushed to a registry, the user must pass in a full image name using the 24 **--tag** option in the format _registry_**/**_repository_**/**_imageName_[**:**_tag_]`. 25 26 ## OPTIONS 27 28 @@option add-host 29 30 @@option annotation.image 31 32 @@option authfile 33 34 @@option build-arg 35 36 @@option build-arg-file 37 38 @@option build-context 39 40 @@option cache-from 41 42 @@option cache-to 43 44 @@option cache-ttl 45 46 @@option cap-add.image 47 48 @@option cap-drop.image 49 50 @@option cert-dir 51 52 @@option cgroup-parent 53 54 @@option cgroupns.image 55 56 #### **--cleanup** 57 58 Remove built images from farm nodes on success (Default: false). 59 60 @@option cpp-flag 61 62 @@option cpu-period 63 64 @@option cpu-quota 65 66 @@option cpu-shares 67 68 @@option cpuset-cpus 69 70 @@option cpuset-mems 71 72 @@option creds 73 74 @@option decryption-key 75 76 @@option device 77 78 Note: if the user only has access rights via a group, accessing the device 79 from inside a rootless container fails. The **[crun(1)](https://github.com/containers/crun/tree/main/crun.1.md)** runtime offers a 80 workaround for this by adding the option 81 **--annotation run.oci.keep_original_groups=1**. 82 83 @@option disable-compression 84 85 @@option dns 86 87 This option cannot be combined with **--network** that is set to **none**. 88 89 Note: this option takes effect only during *RUN* instructions in the build. 90 It does not affect _/etc/resolv.conf_ in the final image. 91 92 @@option dns-option.image 93 94 @@option dns-search.image 95 96 @@option env.image 97 98 @@option farm 99 100 This option specifies the name of the farm to be used in the build process. 101 102 @@option file 103 104 @@option force-rm 105 106 @@option format 107 108 @@option from 109 110 @@option group-add 111 112 @@option help 113 114 @@option hooks-dir 115 116 @@option http-proxy 117 118 @@option identity-label 119 120 @@option ignorefile 121 122 @@option iidfile 123 124 @@option ipc.image 125 126 @@option isolation 127 128 @@option jobs 129 130 @@option label.image 131 132 @@option layer-label 133 134 @@option layers 135 136 #### **--local**, **-l** 137 138 Build image on local machine as well as on farm nodes. 139 140 @@option logfile 141 142 @@option memory 143 144 @@option memory-swap 145 146 @@option network.image 147 148 @@option no-cache 149 150 @@option no-hostname 151 152 @@option no-hosts 153 154 This option conflicts with **--add-host**. 155 156 @@option omit-history 157 158 @@option os-feature 159 160 @@option os-version.image 161 162 @@option pid.image 163 164 #### **--platforms**=*p1,p2,p3...* 165 166 Build only on farm nodes that match the given platforms. 167 168 @@option pull.image 169 170 @@option quiet 171 172 @@option retry 173 174 @@option retry-delay 175 176 @@option rm 177 178 @@option runtime 179 180 @@option runtime-flag 181 182 @@option sbom 183 184 @@option sbom-image-output 185 186 @@option sbom-image-purl-output 187 188 @@option sbom-merge-strategy 189 190 @@option sbom-output 191 192 @@option sbom-purl-output 193 194 @@option sbom-scanner-command 195 196 @@option sbom-scanner-image 197 198 @@option secret.image 199 200 @@option security-opt.image 201 202 @@option shm-size 203 204 @@option skip-unused-stages 205 206 @@option squash 207 208 @@option squash-all 209 210 @@option ssh 211 212 @@option tag 213 214 @@option target 215 216 @@option timestamp 217 218 @@option tls-verify 219 220 @@option ulimit.image 221 222 @@option unsetenv.image 223 224 @@option unsetlabel 225 226 @@option userns.image 227 228 @@option userns-gid-map 229 230 @@option userns-gid-map-group 231 232 @@option userns-uid-map 233 234 @@option userns-uid-map-user 235 236 @@option uts 237 238 @@option volume.image 239 240 ## EXAMPLES 241 242 Build named image and manifest list using specified Containerfile with default farm: 243 ``` 244 $ podman farm build --local -t name -f /path/to/containerfile . 245 ``` 246 247 Build named image and manifest list using the specified farm: 248 ``` 249 $ podman farm build --farm myfarm -t name . 250 ``` 251 252 Build named image and manifest list using the specified farm, removing all images from farm nodes, after they are pushed to registry: 253 ``` 254 $ podman farm build --farm myfarm --cleanup -t name . 255 ``` 256 257 Build named images and manifest list for specified platforms using default farm: 258 ``` 259 $ podman farm build --platforms arm64,amd64 -t name . 260 ``` 261 262 ## SEE ALSO 263 **[podman(1)](podman.1.md)**, **[podman-farm(1)](podman-farm.1.md)**, **[buildah(1)](https://github.com/containers/buildah/blob/main/docs/buildah.1.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**, **[crun(1)](https://github.com/containers/crun/blob/main/crun.1.md)**, **[runc(8)](https://github.com/opencontainers/runc/blob/main/man/runc.8.md)**, **[useradd(8)](https://www.unix.com/man-page/redhat/8/useradd)**, **[Containerfile(5)](https://github.com/containers/common/blob/main/docs/Containerfile.5.md)**, **[containerignore(5)](https://github.com/containers/common/blob/main/docs/containerignore.5.md)** 264 265 ## HISTORY 266 267 September 2023, Originally compiled by Urvashi Mohnani `<umohnani@redhat.com>` 268 269 ## FOOTNOTES 270 <a name="Footnote1">1</a>: The Podman project is committed to inclusivity, a 271 core value of open source. The `master` and `slave` mount propagation 272 terminology used here is problematic and divisive, and needs to be changed. 273 However, these terms are currently used within the Linux kernel and must be 274 used as-is at this time. When the kernel maintainers rectify this usage, 275 Podman will follow suit immediately.