.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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM