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.
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.
replicas. If the service is replicated (which is the default), replicas specifies the number of containers that SHOULD be running at any given time.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With