How to use docker deploy in docker-compose 3? How to use docker deploy in docker-compose 3? docker docker

How to use docker deploy in docker-compose 3?


Your compose.yml file does not include an image section which is required by docker stack deploy. You should also be pushing these images to a registry server if you are deploying them to a swarm since docker uses pinning to the sha256 of the image in the registry to ensure all nodes run the same image. And since swarm does not build the images, any node without the image included locally will not be able to run this image unless it's pulled from a registry.


This is late, but I'd like to say that I got this error when I had a comment in the docker-compose.yml file, like this:

version: "3"services:  web:    # pull the image from repository    image: myname/docker-private:testproj    ...

However, the comment needs to start at the first character of the line:

version: "3"services:  web:# pull the image from repository    image: myname/docker-private:testproj    ...

This fixed the problem.