docker image build <path>

Build an image from a Dockerfile

Arguments

NameDescription
path

Options

NameDescription
--add-host <list>
--build-arg <list>
--cache-from <strings>
--disable-content-trustSkip image verification (default true)
-f, --file <string>Name of the Dockerfile (Default is 'PATH/Dockerfile')
--iidfile <string>Write the image ID to the file
--isolation <string>Container isolation technology
--label <list>Set metadata for an image
--network <string>Set the networking mode for the RUN instructions during build (default "default")
--no-cacheDo not use cache when building the image
-o, --output <stringArray>Output destination (format: type=local,dest=path)
--platform <string>Set platform if server is multi-platform capable
--progress <string>Set type of progress output (auto, plain, tty). Use plain to show container output
--pullAlways attempt to pull a newer version of the image
-q, --quietSuppress the build output and print image ID on success
--secret <stringArray>Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
--squashSquash newly built layers into a single new layer
--ssh <stringArray>SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
-t, --tagName and optionally a tag in the 'name:tag' format
--target <target build stage>Set the target build stage to build