Deploying consul

Hello everyone. Has anyone faced the problem of appointing a consul? Oybka: “The response about the Oybka DT1001 error from the daemon: manifest for consul: the latest version was not found: manifest unknown: manifest unknown If the Oybka is updated, try restarting the Docker desktop.” I googled the error, it turns out that the image is installed and suggest changing the consul to hashicorp/consul.

Link: [hashicorp/consul] Add deprecation notice by mdeggies · Pull Request #2283 · docker-library/docs · GitHub

Actions I have entered: Added a download FROM consul to FROM hashicorp/consul/FROM hashicorp/consul to Dockerfile:past. I loaded the docker-compose build --no-cache command in the console. Reinstalled Docker on the desktop. Uploaded the docker-compose command to the console.

Не помогает и выводится та же ошибка.

Код:

docker-compose.yml

version: "3.8"
services:
  auth:
    image: auth
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:5000
    build: 
      context: ./
      dockerfile: ./AuthService/Dockerfile
    depends_on:
      - auth_db
      - elasticsearch
  auth_db:
    image: mongo
    restart: always
    volumes:
      - ./AuthService/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
      MONGO_INITDB_DATABASE: auth

  notification:
    image: notification_service
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:5000
    build:
      context: ./
      dockerfile: ./NotificationService/Dockerfile
    depends_on:
      - notification_db
      - consul-server
      - elasticsearch

  notification_db:
    image: mongo
    restart: always
    volumes:
      - ./NotificationService/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
      MONGO_INITDB_DATABASE: notification_db
  
  account:
    image: account_service
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:5000
    build:
      context: ./
      dockerfile: ./AccountService/Dockerfile
    depends_on:
      - account_db
      - consul-server
      - elasticsearch
  account_db:
    image: mongo
    restart: always
    volumes:
      - ./AccountService/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
      MONGO_INITDB_DATABASE: account_db
  
  statistics:
    image: statistics_service
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=http://+:5000
    build:
      context: ./
      dockerfile: ./StatisticsService/Dockerfile
    depends_on:
      - statistics_db
      - consul-server
      - elasticsearch
  statistics_db:
    image: mongo
    restart: always
    volumes:
      - ./StatisticsService/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
      MONGO_INITDB_DATABASE: statistics_db
      
  ocelot:
    image: ocelot
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=https://+:5001;http://+:5000
    volumes:
      - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
      - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
    build:
        context: .
        dockerfile: ./OcelotService/Dockerfile
    ports:
      - "8000:5000"
      - "8001:5001"
    depends_on:
      - ocelot_db
      - consul-server
      - elasticsearch

  ocelot_db:
    image: consul:latest
    command: consul agent -dev -log-level=warn -ui -client=0.0.0.0
    hostname: consul
    ports:
      - "8500"
        
  elasticsearch:
    image: elasticsearch:7.10.1
    ports:
    - "9200"
    volumes:
      - ${APPDATA}/ASP.NET/Volumes/Elastic:/usr/share/elasticsearch/data
    environment:
      - xpack.monitoring.enabled=true
      - xpack.watcher.enabled=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.type=single-node 
  
  kibana:
    image: library/kibana:7.10.1
    ports:
      - "5601:5601"
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200

  consul-server:
    build:
        context: .
        dockerfile: ./Consul/Dockerfile
    image: consul-server
    restart: always
    volumes:
     - ./Consul/server.json:/consul/config/server.json:ro
     - ./Consul/certs/:/consul/config/certs/:ro
    command: "agent -bootstrap-expect=1 -client=0.0.0.0"
    ports:
      - "8500:8500"
      - "8600:8600/tcp"
      - "8600:8600/udp"

  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    volumes:
      - ./Prometheus:/etc/prometheus
      - ${APPDATA}/ASP.NET/Volumes/Prometheus:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
    ports:
      - "9090:9090"

  grafana:
   image: grafana/grafana:latest
   container_name: grafana
   volumes:
     - ${APPDATA}/ASP.NET/Volumes/grafana:/var/lib/grafana
     - ./Grafana/provisioning/:/etc/grafana/provisioning
   environment:
     - GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
     - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
     - GF_USERS_ALLOW_SIGN_UP=false
   ports:
     - 3000:3000

docker-compose.dev.yml

version: "3.8"
services:
  auth:
    build: auth
    ports:
      - "27015:5000"
  auth_db:
    build: auth_db
    ports:
      - "27016:27017"

  notification:
    build: notification
    ports:
      - "29960:5000"

  notification_db:
    build: notification_db
    ports:
      - "29900:27017"
  
  account:
    build: account
    ports:
      - "28960:5000"
  account_db:
    build: account_db
    ports:
      - "27017:27017"
  
  statistics:
    build: statistics
    ports:
      - "29500:5000"
  statistics_db:
    build: statistics_db
    ports:
      - "29550:27017"
      
  ocelot:
    build: ocelot

  ocelot_db:
    build: ocelot_db
        
  elasticsearch:
    build: elasticsearch
  
  kibana:
    build: kibana

  consul-server:
    build: consul-server
    ports:
      - "8500:8500"
      - "8600:8600/tcp"
      - "8600:8600/udp"

Consul/Dockerfile

FROM hashicorp/consul:latest

ENV CONSUL_KV_INIT_DIR=/var/local/consul-init.d
RUN mkdir -p $CONSUL_KV_INIT_DIR

COPY ./Consul/consul-init.sh /usr/local/bin/

RUN sed -ie 's|^\(set .*\)|\1\n/usr/local/bin/consul-init.sh \&|' /usr/local/bin/docker-entrypoint.sh
COPY ./Consul/init-configs/ $CONSUL_KV_INIT_DIR/

Consul/consil-init.sh

set -ue

let "timeout = $(date +%s) + 15"

echo "==> Waiting for Consul"
while ! curl -f -s http://localhost:8500/v1/status/leader | grep "[0-9]:[0-9]"; do
  if [ $(date +%s) -gt $timeout ]; then echo "==> Consul timeout"; exit 1; fi
  sleep 1
  echo "==> Waiting for Consul"
done

echo "==> Load configuration"
cd $CONSUL_KV_INIT_DIR

for json_file in $CONSUL_KV_INIT_DIR/**/*.json; do
  key=$(basename "$json_file")
  subprefix=$(basename $(dirname "$json_file"))
  echo "==> Loading $key from $subprefix"
  consul kv put "$subprefix/$key" @$json_file
done

Images: