This is a project to deploy a container from an image in your private docker registry.
- Build the app with the Dockerfile in the my-app-n-dockerfile repository.
- Upload it to dockerhub
- Login to dockerhub from your cli
- Run
cat .docker/config.jsonto get the authentication values. - Convert the file's content to base64
- Enter the values in the
datasection of the docker-secret.yaml file - Run the docker-secret.yaml file
- Next, run the my-app-deployment file with the container image from your registry to deploy it to your k8s cluster.
Note that the spec.template.spec.imagePullSecrets value in the deployment file is what facilitates
the successful connection to your docker private repository.
The spec.template.spec.containers.imagePullPolicy parameter is set to "Always",
so k8s always pulls the image from your private repository when needed.