Answer the question
In order to leave comments, you need to log in
How to run a Docker registry image in Kubernetes?
Hello, I recently started learning kubernetes 2 questions.
1. How to run an image from the Docker registry in Kubernetes?
2. I do this but it doesn't work.
docker run -it httpd /bin/sh
docker commit -m "test" httpd name-image
and then try to run
kubectl create deployment nginx --image=httpd
Am I doing it right?
Answer the question
In order to leave comments, you need to log in
Good afternoon. From the description it is not clear where, what and how you are doing. Let's play a guessing game:
1) minikube:
Go to the minikube shell and do something with the built-in docker and work with images there. Something like this:
host$ docker run -d nginx:latest
host$ docker exec -it <container> /bin/sh
container$ # hack, hack, hack...
container$ exit
host$ docker commit <container> <yuour-image-name:and-tag-here>
apiVersion: v1
kind: Secret
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: <configuration>
metadata:
name: registry-secret
# ...
spec:
imagePullSecrets:
- name: registry-secret
# ...
containers:
- name: php
image: <private-registry-domain>/<image-name:tag-here>
Here is an article that immediately answers all questions. official guide on the official website.
https://kubernetes.io/docs/concepts/workloads/cont...
in the deployment, the containers section is your docker container.
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question