ERROR Unable to push image 'library/web:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied - Kompose up ERROR Unable to push image 'library/web:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied - Kompose up kubernetes kubernetes

ERROR Unable to push image 'library/web:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied - Kompose up


Kubernetes basically requires a Docker registry to be able to work; it cannot build local images. You mention you have a Docker Hub account, so you need to add a reference to that as the container's image: in the docker-compose.yml file.

version: '3'services:  web:    build: .    image: myname/web # <-- add this line    ports:      - 3000:3000    depends_on:      - db    # command: is in the image    # volumes: overwrite code in the image and don't work in k8s

When Kompose tries to push the image, it will use the image: name. You should be able to separately attempt to docker-compose push which will do the same thing.

Note that I deleted the volumes: that bind-mounts your application code into your container. This setup does not work in Kubernetes: it doesn't have access to your local system and you can't predict which node will actually be running your application. It's worth double-checking in plain Docker that your built image works the way you expect, without overwriting its code. (Debugging this in Docker will be easier than debugging it in Kubernetes.)