gcloud builds submit adds --publish for pack builds
Introduced 2026-03-10 · score 0.95
HOW TO USE IT
When building an image directly on Artifact Registry with buildpacks, submit the source with `gcloud builds submit --pack image=<LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REPO_NAME>/<IMAGE_NAME>`. The documented command builds and uploads the image to the repository; the release note says `--publish` is for pack builds.
gcloud builds submit --pack image=<LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REPO_NAME>/<IMAGE_NAME>WHY THIS HELPS
Submit a pack build when building an image directly on Artifact Registry.
REQUIREMENTS AND LIMITATIONS
- --pack (required): Selects the CNCF buildpack build; `image` is required. `builder` and `env` are optional. Mutually exclusive with `--config` and `--tag`.
- --pack image (required): Image name must use the `gcr.io` or `pkg.dev` namespace. For Artifact Registry, use `<LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REPO_NAME>/<IMAGE_NAME>`.
- --pack builder: Optional custom builder image; defaults to `gcr.io/buildpacks/builder`.
- --pack env: Optional environment variables passed to the builder as a list of key-values.
- --publish: The release note says this flag was added to `gcloud builds submit` for pack builds to build images directly on Artifact Registry instead of local Docker. The current command reference does not document this flag.
- Prerequisite: Install and initialize the Google Cloud CLI; enable the Cloud Build and Artifact Registry APIs; have billing enabled and access to a container image repository.
- Prerequisite: Use an Artifact Registry Docker repository and an image name in the `<LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REPO_NAME>/<IMAGE_NAME>` form.
- `--publish` is for pack builds.
- Docs conflict: Current `gcloud builds submit` reference and buildpacks guide do not document `--publish`; release note states it was added for pack builds. The documented current example omits the flag, so an invocation including it cannot be verified from the command reference.
FIRST-PARTY EVIDENCE
- https://docs.cloud.google.com/sdk/docs/release-notes#56000_2026-03-10
- https://docs.cloud.google.com/docs/buildpacks/build-application
- https://docs.cloud.google.com/sdk/gcloud/reference/builds/submit
Check the installed version and the source before using it. Entry JSON