.NET Core开发的iNeuOS工业互联平台,iNeuKernel物联网核心组件在Docker容器中部署。

目       录

1.      概述... 2

2.      演示信息... 2

3.      安装Docker容器... 2

4.      安装dotnet镜像... 3

5.      复制iNeuKernel到容器中... 4

6.      进入指定容器... 4

7.      安装dotnet框架... 4

8.     在Docker容器中运行iNeuKernel物联网框架... 5


 1.   概述

      最近有客户需求:把iNeuOS部署在Docker下。以前实践过部署在Linux的Ubuntu和树莓派中。参见:https://www.cnblogs.com/lsjwq/p/11655093.htmlhttps://www.cnblogs.com/lsjwq/p/11716909.html

      这次我们实践了把物联网核心组件iNeuKernel部署在了Docker容器下,实践证明.NETCore支持云原生方面表现的很好。

      今天就放假了,放了15天。最后一天,发一篇文章。

2.   演示信息

     iNeuOS在线演示:http://demo.ineuos.net  (注:服务器比较慢,请耐心等待。自已注册用户,体验系统功能)

     视频演示:http://www.ineuos.net/video/iNeuOS%20and%20app.mp4

     驱动开发:http://www.ineuos.net/index.php/products/ineukernel-15.html (v2.1版本)

     手机APP:http://demo.ineuos.net/app/ineuos_app.apk

3.   安装Docker容器

(1)Update the apt package index:

   $ sudo apt-get update

 (2)Install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get install \

    apt-transport-https \

    ca-certificates \

    curl \

    gnupg-agent \

    software-properties-common

 (3)Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

 (4)Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

$ sudo apt-key fingerprint 0EBFCD88

 (5)Use the following command to set up the stable repository. To add the nightly or test repository

$ sudo add-apt-repository \

   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \

   $(lsb_release -cs) \

   stable"

 (6)Update the apt package index:

$ sudo apt-get update

 (7)Install the latest version of Docker Engine - Community and containerd:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

 (8)Verify that Docker Engine - Community is installed correctly by running the hello-world image.

sudo docker run hello-world

4.   安装dotnet镜像

(1)在Docker容器中获取dotnet镜像

$ sudo docker pull microsoft/dotnet

 (2)查看当前已有的docker镜像文件

$ sudo docker images

 (3)开始新建并运行一个以dotnet镜像的容器

$ sudo docker run -it microsoft/dotnet
 (4)退出当前容器

$ exit

 (5)查看当前container id:

$ sudo docker ps –a

    如下图:

5.   复制iNeuKernel到容器中

     从宿主机中复制文件到容器中:

$ sudo docker cp /home/developer/work/ iNeuKernelCore-linux-2.2/ 88a36edba257:/opt

     注:88a36edba257 为容器的ID。

6.   进入指定容器

(1)启动容器:

$ sudo docker start 88a36edba257

 (2)进入容器:

$ sudo docker attach 88a36edba257

      注:其他容器命令,请搜索。

7.   安装dotnet框架

$ wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

$ sudo dpkg -i packages-microsoft-prod.deb

$sudo apt-get update

$sudo apt-get install apt-transport-https

$sudo apt-get update

$sudo apt-get install dotnet-sdk-2.2

      注:官网有详细教程。

8. 在Docker容器中运行iNeuKernel物联网框架

      在相应的目录下运行:

root@88a36edba257:/# cd /opt/ iNeuKernelCore-linux-2.2

root@88a36edba257:/# dotnet iNeuKernel.Host.Core.dll

      运行效果如下图:

  注:可以打包成镜像,托管到第三方平台,以后使用直接拉取到本地(docker pull)。


 文章:

 .NET Core开发的iNeuOS工业互联网平台,发布 iNeuDA 数据分析展示组件,快捷开发图形报表和数据大屏

 [视频演示].NET Core开发的iNeuOS物联网平台,实现从设备&PLC、云平台、移动APP数据链路闭环

 .NET Core开发的iNeuOS物联网平台部署树霉派(raspbian),从网关到云端整体解决方案

 .NET Core开发的iNeuOS物联网平台部署在Ubuntu操作系统,无缝跨平台

 iNeuOS 物联网云操作系统2.0发布,集成设备容器、视图建模、机器学习三大模块

 iNeuOS云操作系统,.NET Core全系打造


 物联网&大数据技术 QQ群:54256083 

 物联网&大数据合作 QQ群:727664080

 网站:http://www.ineuos.net

 联系QQ:504547114

 合作微信:wxzz0151

 

posted @ 2020-01-19 12:05  iNeuOS工业互联网系统  阅读(892)  评论(0编辑  收藏  举报