前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >.NET Core开发的iNeuOS工业互联平台,iNeuKernel物联网核心组件在Docker容器中部署。

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

原创
作者头像
唯笑志在
修改2020-04-15 10:23:46
4660
修改2020-04-15 10:23:46
举报
文章被收录于专栏:iNeuOSiNeuOS

目       录

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

代码语言:javascript
复制
 (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)。


原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 2.   演示信息
  • 3.   安装Docker容器
  • 4.   安装dotnet镜像
  • 5.   复制iNeuKernel到容器中
  • 6.   进入指定容器
  • 7.   安装dotnet框架
  • 8. 在Docker容器中运行iNeuKernel物联网框架
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档