Skip to content
- Edit /etc/hosts and map host
<$minikube ip> host.minikube.internal Add insecere-registries=”host.minikube.internal:5000″ in daemon.jsonRestart dockerStart minikube insecure mode
minikube start –insecure-registry=host.minikube.internal:5000 –insecure-registry=192.168.1.37- Setup selfcert http://www.selfsignedcertificate.com/ and save host.minikube.internal.cert and host.minikube.internal.key
- Copy selfcert to minikube node
scp -i $(minikube ssh-key) -pr selfcert/ docker@$(minikube ip):
6.1 minikube ssh
6.2 sudo cp -rvf selfcert /etc/docker/certs.d/host.minikube.internal:5000
6.3 cd /etc/docker/certs.d/host.minikube.internal:5000 ; sudo openssl s_client -showcerts -connect host.minikube.internal:5000 < /dev/null | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > ca.crt
6.4 exit from minikube - Create docker user and password
docker container run -i –rm –entrypoint htpasswd registry:2.6.2
-Bbn admin password >> ./selfcert/htpasswd - Copy cert to host
cp cert to /etc/docker/certs.d
sudo cp -rvf selfcert /etc/docker/certs.d/host.minikube.internal:5000 - Create ca.crt file
openssl s_client -showcerts -connect : host.minikube.internal:5000 < /dev/null | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > ca.crt - Run registry
docker container run -itd -p 5000:5000
–name registry
–restart=always
-v /home/warawich/Documents/registry/selfcert:/certs
-v /home/warawich/Documents/registry/selfcert:/auth
-e “REGISTRY_AUTH=htpasswd”
-e “REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm”
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
-e REGISTRY_STORAGE_DELETE_ENABLED=true
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/host.minikube.internal.cert
-e REGISTRY_HTTP_TLS_KEY=/certs/host.minikube.internal.key
registry:2.6.2 - Testing login from Host
docker login host.minikube.internal:5000 - Testing login from minikube
minikube ssh – docker login host.minikube.internal:5000