Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use docker deploy in docker-compose 3?

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.

like image 747
Анастасия Руденко Avatar asked Jun 05 '17 13:06

Анастасия Руденко


People also ask

Where is Docker compose deployed?

You can use Compose to deploy an app to a remote Docker host by setting the DOCKER_HOST , DOCKER_TLS_VERIFY , and DOCKER_CERT_PATH environment variables appropriately. See also Compose CLI environment variables.

What is deploy replicas in Docker compose?

replicas. If the service is replicated (which is the default), replicas specifies the number of containers that SHOULD be running at any given time.

What are the three main steps of Docker compose?

Using Compose is basically a three-step process: Define your app's environment with a Dockerfile so it can be reproduced anywhere. Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment.


1 Answers

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.

like image 60
BMitch Avatar answered Sep 30 '22 00:09

BMitch