EdgeX(4)使用docker-compose 启动 edgex 服务,依赖很多,并且开启 camera service ,

目录

  • 前言
  • 1,关于EdgeX
  • 2,安装 docker-compose
  • 3,关于配置文件
  • 3,总结

前言


相关EdgeX Foundry 全部分类:
https://blog.csdn.net/freewebsys/category_9437788.html

本文的原文连接是:
https://blog.csdn.net/freewebsys/article/details/104704805

未经博主允许不得转载。
博主地址是:http://blog.csdn.net/freewebsys

1,关于EdgeX


是一个边缘设备服务发现框架。

2,安装 docker-compose


安装 curl:最新的是 1.25.1
https://github.com/docker/compose/releases

sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

3,关于配置文件


最新版本是 fuji 。1.1.0 版本。
https://github.com/edgexfoundry/developer-scripts/blob/master/releases/fuji/compose-files/docker-compose-fuji.yml

根据配置文件然进行修改下,去掉不使用的服务:
修改如下:

# /*******************************************************************************
#  * Copyright 2018 Dell Inc.
#  *
#  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
#  * in compliance with the License. You may obtain a copy of the License at
#  *
#  * http://www.apache.org/licenses/LICENSE-2.0
#  *
#  * Unless required by applicable law or agreed to in writing, software distributed under the License
#  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
#  * or implied. See the License for the specific language governing permissions and limitations under
#  * the License.
#  *
#  * @author: Jim White, Dell
#  * EdgeX Foundry, Fuji, version 1.1.0
#  * added: Jun 30, 2019
#  *******************************************************************************/

version: '3.4'

# all common shared environment variables defined here:
x-common-env-variables: &common-variables
  edgex_registry: consul://edgex-core-consul:8500
  Clients_CoreData_Host: edgex-core-data
  Clients_Logging_Host: edgex-support-logging
  Logging_EnableRemote: "true"

volumes:
  db-data:
  log-data:
  consul-config:
  consul-data:
  consul-scripts:
  portainer_data:
  vault-config:
  vault-file:
  vault-logs:
  secrets-setup-cache:

services:
  volume:
    image: edgexfoundry/docker-edgex-volume:1.1.0
    container_name: edgex-files
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data

  consul:
    image: edgexfoundry/docker-edgex-consul:1.1.0
    ports:
      - "8400:8400"
      - "8500:8500"
    container_name: edgex-core-consul
    hostname: edgex-core-consul
    networks:
      edgex-network:
        aliases:
          - edgex-core-consul
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - consul-scripts:/consul/scripts
      - vault-config:/vault/config
    depends_on:
      - volume

  config-seed:
    image: edgexfoundry/docker-core-config-seed-go:1.1.0
    container_name: edgex-config-seed
    hostname: edgex-core-config-seed
    networks:
      edgex-network:
        aliases:
          - edgex-core-config-seed
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
    depends_on:
      - volume
      - consul

  mongo:
    image: edgexfoundry/docker-edgex-mongo:1.1.0
    ports:
      - "27017:27017"
    container_name: edgex-mongo
    hostname: edgex-mongo
    entrypoint: >
      /bin/sh -c
      "until /consul/scripts/consul-svc-healthy.sh security-secretstore-setup; do sleep 1; done;
      /edgex-mongo/bin/edgex-mongo-launch.sh"
    networks:
      - edgex-network
    volumes:
      - vault-config:/vault/config
      - consul-scripts:/consul/scripts
    depends_on:
      - volume
      - vault-worker

  logging:
    image: edgexfoundry/docker-support-logging-go:1.1.0
    ports:
      - "48061:48061"
    container_name: edgex-support-logging
    hostname: edgex-support-logging
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - config-seed
      - mongo
      - volume

  system:
    image: edgexfoundry/docker-sys-mgmt-agent-go:1.1.0
    ports:
      - "48090:48090"
    container_name: edgex-sys-mgmt-agent
    hostname: edgex-sys-mgmt-agent
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - logging

  notifications:
    image: edgexfoundry/docker-support-notifications-go:1.1.0
    ports:
      - "48060:48060"
    container_name: edgex-support-notifications
    hostname: edgex-support-notifications
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - logging

  metadata:
    image: edgexfoundry/docker-core-metadata-go:1.1.0
    ports:
      - "48081:48081"
    container_name: edgex-core-metadata
    hostname: edgex-core-metadata
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - logging

  data:
    image: edgexfoundry/docker-core-data-go:1.1.0
    ports:
      - "48080:48080"
      - "5563:5563"
    container_name: edgex-core-data
    hostname: edgex-core-data
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - logging

  command:
    image: edgexfoundry/docker-core-command-go:1.1.0
    ports:
      - "48082:48082"
    container_name: edgex-core-command
    hostname: edgex-core-command
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - metadata

  scheduler:
    image: edgexfoundry/docker-support-scheduler-go:1.1.0
    ports:
      - "48085:48085"
    container_name: edgex-support-scheduler
    hostname: edgex-support-scheduler
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
      - vault-config:/vault/config
    depends_on:
      - metadata

  app-service-rules:
    image: edgexfoundry/docker-app-service-configurable:1.0.0
    ports:
      - "48100:48100"
    container_name: edgex-app-service-configurable-rules
    hostname: edgex-app-service-configurable-rules
    networks:
      edgex-network:
        aliases:
          - edgex-app-service-configurable-rules
    environment:
      <<: *common-variables
      edgex_service: http://edgex-app-service-configurable-rules:48100
      edgex_profile: rules-engine
      Service_Host: edgex-app-service-configurable-rules
      MessageBus_SubscribeHost_Host: edgex-core-data
    depends_on:
      - consul
      - logging
      - data


  #################################################################
  # Device Services
  #################################################################

  device-virtual:
    image: edgexfoundry/docker-device-virtual-go:1.1.1
    ports:
      - "49990:49990"
    container_name: edgex-device-virtual
    hostname: edgex-device-virtual
    networks:
      edgex-network:
        aliases:
          - edgex-device-virtual
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
    depends_on:
      - data
      - command

  device-modbus:
     image: edgexfoundry/docker-device-modbus-go:1.1.1
     ports:
       - "49991:49991"
     container_name: edgex-device-modbus
     hostname: edgex-device-modbus
     networks:
       - edgex-network
     volumes:
       - db-data:/data/db
       - log-data:/edgex/logs
       - consul-config:/consul/config
       - consul-data:/consul/data
     depends_on:
       - data
       - command

  device-snmp:
     image: edgexfoundry/docker-device-snmp-go:1.1.1
     ports:
       - "49993:49993"
     container_name: edgex-device-snmp
     hostname: edgex-device-snmp
     networks:
       - edgex-network
     volumes:
       - db-data:/data/db
       - log-data:/edgex/logs
       - consul-config:/consul/config
       - consul-data:/consul/data
     depends_on:
       - data
       - command

  device-camera:
    image: edgexfoundry/docker-device-camera-go:1.0.0
    ports:
      - "49994:49994"
    container_name: edgex-device-camera
    hostname: edgex-device-camera
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
    depends_on:
      - data
      - command

  #################################################################
  # UIs
  #################################################################
  ui:
    image: edgexfoundry/docker-edgex-ui-go:1.1.0
    ports:
      - "4000:4000"
    container_name: edgex-ui-go
    hostname: edgex-ui-go
    networks:
      - edgex-network
    volumes:
      - db-data:/data/db
      - log-data:/edgex/logs
      - consul-config:/consul/config
      - consul-data:/consul/data
    depends_on:
      - data
      - command


networks:
  edgex-network:
    driver: "bridge"

保存成: docker-compose.yml
docker-compose -d up

3,总结


开源边缘计算框架 EdgeX Foundry,做设备服务发现。
IP Camera ,发现局域网内部摄像头的。

本文的原文连接是:
https://blog.csdn.net/freewebsys/article/details/104704805

博主地址是:https://blog.csdn.net/freewebsys

你可能感兴趣的:(edgex,docker)