docker compose build

DescriptionBuild or rebuild services
Usagedocker compose build [OPTIONS] [SERVICE...]

Description

Services are built once and then tagged, by default as project-service.

If the Compose file specifies an image name, the image is tagged with that name, substituting any variables beforehand. See variable interpolation.

If you change a service's Dockerfile or the contents of its build directory, run docker compose build to rebuild it.

Options

OptionDefaultDescription
--build-argSet build-time variables for services
--builderSet builder to use
-m, --memorySet memory limit for the build container. Not supported by BuildKit.
--no-cacheDo not use cache when building the image
--pullAlways attempt to pull a newer version of the image
--pushPush service images
-q, --quietDon't print anything to STDOUT
--sshSet SSH authentications used when building service images. (use 'default' for using your default SSH Agent)
--with-dependenciesAlso build dependencies (transitively)