How do I push a Docker Image in Virtual Box to Google repository?

8/8/2018

I have a virtualbox development:

$docker-machine ls

NAME          ACTIVE   DRIVER     STATE        URL             SWARM  DOCKER ERRORS
development    -     virtualbox  Running  tcp://*.*.*.*:****  v18.05.0-ce   

Inside development I have this:

$docker images
REPOSITORY            TAG      IMAGE ID         CREATED         SIZE
busybox              latest   e1ddd7948a1c      1 day ago      1.16MB
pritam/play-docker   latest   34eb2664f14e      1 day ago      1.4GB

Now I want to push this image inside virtual box to google repository. How do I that?

-- Pritam Banerjee
docker
dockerfile
google-kubernetes-engine
kubernetes
kubernetes-ingress

1 Answer

8/20/2018

you can use docker push command

docker push imageTagName

http://docs.docker.com/engine/reference/commandline/push

For your own registry you can use

 docker push registry.example.com/image 

http://blog.docker.com/2013/07/how-to-use-your-own-registry.

And for google container registry reference:

http://cloud.google.com/container-registry/docs/pushing-and-pulling

docker [push/pull] gcr.io/{PROJECT_ID}/{image}:tag 

for authentication you can check google container registry reference

https://medium.com/google-cloud/using-googles-private-container-registry-with-docker-1b470cf3f50a

after you get google auth keys as json format (key.json)

docker login -u _json_key -p “$(cat key.json)

after login success you can push your image

 docker push gcr.io/project_id/imageName:tag
-- Fahri
Source: StackOverflow