How to work with docker-compose file?

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.15.2
Host OS: Ubuntu
First I change the environment with : eval $(minikube docker-env)

If I run with kompose up command I got the “Unable to push image ‘library/web:latest’ to registry ‘docker.io’. unauthorized: incorrect username or password
FATA Error while deploying application: k.Transform failed: Unable to push Docker image for service web: unable to push docker image(s). Check that docker login works successfully on the command line” error.
If I run docker-compose up without changing my environment, it works very well. How can I solve it?

Here is docker-compose file.

version: '3'

services:
  nginx:
    image: nginx:latest
    volumes:
      - ./nginx.conf
    ports:
      - 8888:80
    depends_on:
      - web
  web:
    image : web
    build:
      context: .
      dockerfile: Dockerfile
    ports:
        - 5000:5000
    depends_on:
          - logstash
 
  logstash:
    image: docker.elastic.co/logstash/logstash-oss:6.2.4
    volumes:
      - ./logstash-simple.conf
    expose:
      - 5140/udp    
    depends_on:
      - elasticsearch
  elasticsearch:
    image: elasticsearch:5.5-alpine
    environment:
      - cluster.name=docker-clusters
      - bootstrap.memory_lock=true
      - xpack.security.enabled=false
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "5601:5601"
      - "9200:9200"
      - "5044:5044"

Any idea to solve that problem?

The error you pasted says:

Check that docker login works successfully on the command line” error.

Have you checked that?

I checked and couldn’t login. I think there is no need login docker as my image located in my localhost. Am I wrong ?

I’m not familiar with kompose, but I guess it should. And given that the error seems to say that…

Think that minikube needs to download the container image from somewhere. As it is using a VM, it doesn’t know about your local docker daemon and you probably don’t have a docker registry to expose container builds.

That’s why I think, besides the error, that you need that.

What I’ve used in the past with minikube is --vm-driver none and have it use the local docker daemon, so you can avoid having a registry (as the image is already there). Maybe you can check that setups if you want?