Я пытаюсь развернуть приложение со стеком docker. После сборки и тестирования с помощью docker -compose (которые запустили совершенно нормально ), я создал рой, присоединился к нему и попытался запустить
docker stack deploy --compose-file docker-compose.yml default
Произошла следующая ошибка:
failed to create service default_sharkcop-api: Error response from daemon: rpc error: code = InvalidArgument desc = ContainerSpec: image reference must be provided
Вот мой docker -compose.yml
version: "3"
services:
# Define the api web application
sharkcop-api:
# Build the Dockerfile that is in the web directory
build:
context: ./sharkcop-api
dockerfile: Dockerfile
# Always restart the container regardless of the exit status; try and restart the container indefinitely
restart: always
# Expose port 8000 to other containers (not to the host of the machine)
expose:
- "8080"
# Link the containers together so they can talk to one another
links:
- redis
# Pass environment variables to the flask container (this debug level lets you see more useful information)
environment:
port: 8080
REDIS_URL: redis://cache
# Deploy with three replicas in the case one of the containers fails (only in Docker Swarm)
deploy:
mode: replicated
replicas: 3
# Define the NGINX forward proxy container
nginx:
# build the nginx Dockerfile
build:
context: ./reverse-proxy
dockerfile: Dockerfile
restart: always
# Expose port 80 to the host machine
ports:
- "80:80"
deploy:
mode: replicated
replicas: 3
# The application needs to be available for NGINX to make successful proxy requests
depends_on:
- sharkcop-api
# Define the sharkcop-webinspector
sharkcop-webinspector:
build:
context: ./sharkcop-webinspector
dockerfile: Dockerfile
restart: always
expose:
- "8080"
# Mount the web directory within the container at /app/sharkcop-webinspector
volumes:
- ./sharkcop-webinspector:/app/sharkcop-webinspector
links:
- sharkcop-api
deploy:
mode: replicated
replicas: 3
redis:
image: redis
container_name: cache
command: ["redis-server", "--appendonly", "yes"]
restart: always
expose:
- 6379
volumes:
- ./data/redis:/data
Я использую Docker версия 19.03.8, сборка afacb8b и docker - составить версию 1.25.4, сборка 8d51620a