Reputation: 9285
I am running one container on GCE via
gcloud compute instances create-with-container [INSTANCE_NAME]
--container-image='gcr.io/xxxxx'
https://cloud.google.com/sdk/gcloud/reference/compute/instances/create-with-container
My question is how to specify the container name, which is similar to docker run --name
.
Upvotes: 5
Views: 1360
Reputation: 971
You do not need to specify the container name when creating the instance.
If your objective is to get to the bash shell of the running container, you can do the following:
gcloud compute ssh <instance-name>
after it is created with a deployed container.docker ps
, take note of the name of the container docker exec -it <container-name> bash
and you'll bring up the bash shell for the running container.Upvotes: 1
Reputation: 40326
It appears to not be possible.
It's a reasonable request.
I recommend you file a feature request on Google's Issue Tracker for Cloud SDK (gcloud
) and that you document use-case(s) for needing to query the container by the name there.
Use-cases help justify implementation.
HTH
Upvotes: 2