docker | docker-compose clear cache
Buildorrebuildservicesdockercomposebuild[OPTIONS][SERVICE...]Servicesarebuiltonceandthentagged,bydefaultasproject_service.IftheComposefilespecifiesanimageopen_in_new[1]name,theimageistaggedwiththatname,substitutinganyvariablesbeforehand.Seevariableinterpolationopen_in_new[2].IfyouchangeaservicesDockerfileorthecontentsofitsbuilddirectory,rundockercomposebuildtorebuildit.OptionShortDefaultDescription--build-argSetbuild-timevariablesforservices.--builderSetbuildertouse.--compresstrueCompressthe...
Build or rebuild services
docker compose build [OPTIONS] [SERVICE...]Services are built once and then tagged, by default as project_service.
If the Compose file specifies an imageopen_in_new[1] name, the image is tagged with that name, substituting any variables beforehand. See variable interpolationopen_in_new[2].
If you change a services Dockerfile or the contents of its build directory, run docker compose build to rebuild it.
OptionShortDefaultDescription--build-argSet build-time variables for services.--builderSet builder to use.--compresstrueCompress the build context using gzip. DEPRECATED--force-rmtrueAlways remove intermediate containers. DEPRECATED--memory-mSet memory limit for the build container. Not supported by BuildKit.--no-cacheDo not use cache when building the image--no-rmDo not remove intermediate containers after a successful build. DEPRECATED--paralleltrueBuild images in parallel. DEPRECATED--progressautoSet type of ui output (auto, tty, pla...