0
votes

I made a docker-compose service and it work correctly.

I install minikube and I can access it throw web interface http://127.0.0.1:35591/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/overview?namespace=default

But when i try to do a "kompose up" on my docker folder it failed, see under.

It seems that kompose try to push on docker.io instead of my local minikube ?!

How configure kompose to push on my local minikube ?

INFO Building image 'ubuntu' from directory 'test-docker' 
INFO Image 'ubuntu' from directory 'test-docker' built successfully 
INFO Pushing image 'library/ubuntu:latest' to registry 'docker.io' 
WARN Unable to retrieve .docker/config.json authentication details. Check that 'docker login' works successfully on the command line.: open /home/wizard/.dockercfg: no such file or directory 
INFO Authentication credentials are not detected. Will try push without authentication. 
INFO Attempting authentication credentials 'docker.io 
ERRO Unable to push image 'library/ubuntu:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied 
FATA Error while deploying application: k.Transform failed: Unable to push Docker image for service test: unable to push docker image(s). Check that `docker login` works successfully on the command line```

Try 1 : eval $(minikube docker-env) - Failed 

```$ minikube start
????  minikube v1.11.0 on Ubuntu 18.04
✨  Using the docker driver based on existing profile
????  Starting control plane node minikube in cluster minikube
????  Restarting existing docker container for "minikube" ...
????  Preparing Kubernetes v1.18.3 on Docker 19.03.2 ...
    ▪ kubeadm.pod-network-cidr=10.244.0.0/16
????  Verifying Kubernetes components...
????  Enabled addons: dashboard, default-storageclass, storage-provisioner
????  Done! kubectl is now configured to use "minikube"
$ eval $(minikube docker-env)
$ kompose up
INFO Build key detected. Attempting to build and push image 'ubuntu' 
INFO Building image 'ubuntu' from directory 'striper-docker' 
INFO Image 'ubuntu' from directory 'striper-docker' built successfully 
INFO Pushing image 'library/ubuntu:latest' to registry 'docker.io' 
WARN Unable to retrieve .docker/config.json authentication details. Check that 'docker login' works successfully on the command line.: open /home/wizard/.dockercfg: no such file or directory 
INFO Authentication credentials are not detected. Will try push without authentication. 
INFO Attempting authentication credentials 'docker.io 
ERRO Unable to push image 'library/ubuntu:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied 
FATA Error while deploying application: k.Transform failed: Unable to push Docker image for service striper: unable to push docker image(s). Check that `docker login` works successfully on the command line ```
1
I don't understood, are you trying to push image do minikube? Do you have a private registry installed on minikube? - Mr.KoopaKiller
No I don't, it's my first try, tutorial don't speak about this ? I found this : github.com/kubernetes/minikube/issues/321 it may help ? - WCdr
Please share the link of the tutorial you are following. You need a registry to push/pull the images, as I can see in your log, kompose is trying to push your image to docker.io (default). - Mr.KoopaKiller

1 Answers

0
votes

I guess you are trying to execute compose command to up your services in minikube.If thats the case, execute this command

eval $(minikube docker-env)

This will set the docker to minikube environment.Then execute the required docker command.

Run eval $(minikube docker-env) on each terminal you want to use, as it only sets the environment variables for the current shell session. Hope this helps.