Usage
Arguments
Names of specific services to build. If not specified, all services with a
build section are built.Flags
Set a build-time variable for services. Used in Dockerfiles that declare the variable with ARG. Can be specified multiple times.Format:
--build-arg VAR=VALUE--check
Check the build configuration for services without building them.
--deps
Also build services declared as dependencies of the selected services.
One or more Compose files to build. Default:
compose.yamlMachine names or IDs to push the built images to (requires
--push). Can be specified multiple times or as a comma-separated list. Default is all machines or x-machines specified in the Compose file.--no-cache
Do not use cache when building images.
One or more Compose profiles to enable.
--pull
Always attempt to pull newer versions of base images before building.
--push
Upload the built images to cluster machines after building. Use
--machine to specify which machines. Default is all machines.--push-registry
Upload the built images to external registries (for example, Docker Hub) after building.
Examples
Build all services
Build specific services
Build and push to cluster
Push to all machines:Build and push to external registry
Build with build arguments
Build without cache
Build with newer base images
Build with dependencies
Build service and its dependencies:Check build configuration
Verify Dockerfiles without building:Compose File Example
A service with a build configuration:Build Arguments
Pass build arguments to Dockerfiles: Dockerfile:Pushing Images
Push to Cluster
After building, push images to cluster machines:Push to Specific Machines
Push only to machines that will run the service:Push to External Registry
Push to Docker Hub or other registries:Build vs Deploy
uc build- Only builds imagesuc deploy- Builds images AND deploys services
uc build when you want to build without deploying:
uc deploy for the full workflow:
Build Output
--push:
No Services to Build
If no services have abuild section:
