Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

gcloud app deploy command, Container Registry deprecation and Artifact Registry migration

Hi there,
 
I am currently working on migrating from Container Registry to Artifact Registry, however there is a point that is a bit unclear for me.
 
We run the "gcloud app deploy" cli command to publish our app and that automatically builds the container image based on the Dockerfile and pushes it to the Container Registry. As far as I can tell from the documentation, there is no flag or anything to make it point to Artifact Registry. So what am I missing?
 
Should I be using the "--image-url=" flag?
Or is it something else that needs to be done?
Or will "gcloud app deploy" publish the images to Artifact Registry automatically from 18/03/2025?
 
If anyone knows something that might help, I'd be grateful.
Thanks a lot!
2 REPLIES 2

The "gcloud app deploy" command currently defaults to pushing images to Container Registry. As of now, there is no direct flag to redirect the image to Artifact Registry. However, here’s what you need to know:

gcloud app deploy --image-url=LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG

If you don't want to specify --image-url each time, you can update your App Engine settings to use Artifact Registry:

gcloud config set app/use_artifact_registry true

This will ensure that gcloud app deploy automatically pushes images to Artifact Registry instead of Container Registry.






Hi, @cfa-ez.

Before answering your question, I have one for you - "Are you planning to migrate your existing container registry to Artifact Registry when you deploy? Or are you primarily only focusing on the gcloud app deploy command?

Currently in the GCP, you can no longer create new container registries. When you use the gcloud app deploy command, it will automatically create an Artifact Registry if previously not present for that. If you're using Container Registry previously, it will be migrated to Artifact Registry with a URL similar to gcr.io. As a result, you no longer need to specify additional arguments to define the container or artifact registry.

Regards,
Mokit