Make Nginx image available in local/private repository for production safe perspective in kubernetes

2/1/2018

How can we make nginx image available in my local/private repository in kubernetes?

Lets say i am using nginx image tag version x.x. I have tested it in my dev and test env and want to move it to prod.

What if the image is not present in nginx repository? Is there a way to pull the x.x version of nginx to our local/private repository?

There is a high risk if the image is not available. So it would be helpful if anyone guide me how we handle this.

-- Anil Kumar P
docker
kubernetes
nginx

1 Answer

2/1/2018

If you have docker installed in your machine, pull docker image

$ docker pull nginx:x.x

Now, you can't use this local docker image inside Kubernetes. You need to do additional thing

Push this image into your docker registry in cloud.

$ docker tag nginx:x.x <your-registry>/nginx:x.x
$ docker push <your-registry>/nginx:x.x

And then use <your-registry>/nginx:x.x from your registry.

-- Mir Shahriar Sabuj
Source: StackOverflow