This docker compose build
command is used to build or rebuild the services. Services are built once and then tagged as project_service
, e.g., cloudyfox_db
. If you change a service’s Dockerfile
or the contents of its build directory, run docker-compose build
to rebuild it.
$ docker compose build [OPTIONS] [SERVICE...]
Here,
OPTIONS:
—force-rm
→ Always remove intermediate containers.—no-cache
→ Do not use cache when building the image.—pull
→ Always attempt to pull a newer version of the image.—build-arg
→ Set build time variables—quiet
or -q
→ No print to STDOUT