How to use docker deploy in docker-compose 3?

Viewed 7559

When I make command sudo docker stack deploy -c docker-compose.yml test

Ignoring unsupported options: build, external_links, links, restart

Updating service test_cache (id: me2vh1lffrl4ppzomphin167la)
Updating service test_lb (id: ycnne1ifpt517wdbfdg1g5tlup)
Updating service test_media (id: rr3ural9hjz0mw6hjx7n2vywm)
Creating service test_web

Error response from daemon: rpc error: code = 3 desc = ContainerSpec: image reference must be provided

And I get this error - Error response from daemon: rpc error: code = 3 desc = ContainerSpec: image reference must be provided

But I create image for this container.

2 Answers

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.

Related