Gcloud: Deploy local image without pushing to registry

4/26/2018

I have a local image that works fine locally. I want to deploy it to my gcloud kubectl. Is there a way I can deploy it without pushing it to container registry. When I do it its throwing: docker pull access denied repository does not exist or may require 'docker login'

I have the image locally, so why would I need to pull it from the registry. The only way I have been working is pushing the image to gcr.io.

Just wondering, if there is a workaround

-- rray
google-cloud-platform
google-cloud-storage
google-container-registry
google-kubernetes-engine
kubernetes

1 Answer

4/26/2018

Since your cluster is hosted in the cloud (gcloud), it doesn't have any kind of connection with your local machine.

To be able to do so, you'll need to share the/var/run/docker.sock of your local machine with the remote one. Even though, it's really bad idea to share the socket.

That's why, when you're trying to pull an image, if you don't specify any registry host, it will try to pull the image from dockerhub.

-- Idir Ouhab Meskine
Source: StackOverflow