When you create an instance on google compute engine there is an option to "Deploy a container image to this VM instance", which if you select asks for a container image
In the box for the container image it says "for example, gcr.io/google-containers/busybox" and clicking on the question mark next to the words "Container image" brings up "Name of a public image on any registry, or a private image hosted on Google Container Registry."
From this I infer that I can deploy an image directly from docker hub without needing to first upload it to the google container repository. However, I am having trouble with how I am supposed to direct the instance to the desired image.
For example if the image is username/repo:tag, I have tried putting username/repo
or username/repo:tag
as the container image, but when I load up the instance I am not in the container and the image isn't even listed on the docker images -a
What address should I be using?
Yes, you may deploy an image directly from the docker hub.
When creating an instance in GCE, in the Container Image text box, you have to type the full path of the docker hub repository.
For instance, for the nginx public docker image, the container image that you should type is registry.hub.docker.com/library/nginx
The registry path for any official docker hub image should be written in the following way: registry.hub.docker.com/library/image
.
For a private docker image, the container image that you should type is registry.hub.docker.com/username/repo
or registry.hub.docker.com/username/repo:tag
.
docker.io/<username>/<repo>:<tag>
works as well. Of course it points to the same registry as registry.hub.docker.com
, but the pattern nicely matches gcr.io/<username>/<repo>:<tag>
.
You can use registry.hub.docker.com/<username>/<image-name>:<tag>
So to deploy to GKE
registry.hub.docker.com/<username>/<image-name>:<tag>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.