EdgeX (4) uses docker-compose to start the edgex service, which relies on a lot, and starts the camera service,

Preface


Related EdgeX Foundry categories:
https://blog.csdn.net/freewebsys/category_9437788.html

The original link of this article is:
https://blog.csdn.net/freewebsys/article/details/104704805

Reprinting is not allowed without the permission of the blogger.
The blogger's address is: http://blog.csdn.net/freewebsys

1. About EdgeX


Is an edge device service discovery framework.

2. Install docker-compose


Install curl: The latest is 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. About the configuration file


The latest version is fuji. Version 1.1.0.
https://github.com/edgexfoundry/developer-scripts/blob/master/releases/fuji/compose-files/docker-compose-fuji.yml

Modify according to the configuration file and remove the unused services:
modify as follows:

# /*******************************************************************************
#  * 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. Summary


The open source edge computing framework EdgeX Foundry is used for device service discovery.
IP Camera, found the camera inside the LAN.

The original link of this article is:
https://blog.csdn.net/freewebsys/article/details/104704805

The blogger address is: https://blog.csdn.net/freewebsys

Guess you like

Origin blog.csdn.net/freewebsys/article/details/104704805