「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
...と言う事で、以下、Rasbian上で、.NET Coreの開発を行う。
実際にやったログ
コチラ(Windows 10 IoT Core)で思い出す。
以下を参考に、Raspberry Pi 3 MODEL Bに.NET 5をインストール。
wget https://download.visualstudio.microsoft.com/download/pr/fada9b0c-202a-4720-817b-b8b92dddad99/fa6ace43156b7f73e5f7fb3cdfb5c302/dotnet-sdk-5.0.202-linux-arm.tar.gz
mkdir -p "$HOME/dotnet" && tar zxf dotnet-sdk-5.0.202-linux-arm.tar.gz -C "$HOME/dotnet"
sudo vi ~/.profile
export DOTNET_ROOT=$HOME/dotnet export PATH=$PATH:$DOTNET_ROOT
$ dotnet -v Unknown option: -v .NET SDK (5.0.202) 使用法: dotnet [runtime-options] [path-to-application] [arguments] ...
dotnet new console -o helloworld cd helloworld dotnet run
(.NET Core On Rasbian On Docker)
一旦、.NET CoreのDockerコンテナのhelloworldをやってみる。
ENTRYPOINT ["dotnet", "dotnetapp.dll"]
ENTRYPOINT ["dotnet", "helloworld.dll"]
docker build -t helloworld .
>docker images REPOSITORY TAG IMAGE ID ... helloworld latest XXXXXXXX ...
docker run helloworld Hello World!
docker tag XXXXXXXX osscjpdevinfra/helloworld:latest
>docker login Authenticating with existing credentials... Login Succeeded
>docker push osscjpdevinfra/helloworld:latest
>docker rmi XXXXXXXX -f ... Deleted: sha256:...・Docker Hubからプルして実行。
>docker run osscjpdevinfra/helloworld Unable to find image 'osscjpdevinfra/helloworld:latest' locally latest: Pulling from osscjpdevinfra/helloworld ... Status: Downloaded newer image for osscjpdevinfra/helloworld:latest Hello World!
>docker run osscjpdevinfra/helloworld Unable to find image 'osscjpdevinfra/helloworld:latest' locally latest: Pulling from osscjpdevinfra/helloworld ... Status: Downloaded newer image for osscjpdevinfra/helloworld:latest WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested standard_init_linux.go:219: exec user process caused: exec format error
You may also need to include 'linux-arm' in your project's RuntimeIdentifiers.
<RuntimeIdentifiers>linux-arm</RuntimeIdentifiers>
>docker run osscjpdevinfra/dotnetapp:debian-arm32 WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders
>docker run osscjpdevinfra/dotnetapp:debian-arm32
Unable to find image 'osscjpdevinfra/dotnetapp:debian-arm32' locally
debian-arm32: Pulling from osscjpdevinfra/dotnetapp
...
Digest: sha256:...
Status: Downloaded newer image for osscjpdevinfra/dotnetapp:debian-arm32
Hello from .NET Core!
__________________
\
\
....
....'
....
..........
.............'..'..
................'..'.....
.......'..........'..'..'....
........'..........'..'..'.....
.'....'..'..........'..'.......'.
.'..................'... ......
. ......'......... .....
. ......
.. . .. ......
.... . .......
...... ....... ............
................ ......................
........................'................
......................'..'...... .......
.........................'..'..... .......
........ ..'.............'..'.... ..........
..'..'... ...............'....... ..........
...'...... ...... .......... ...... .......
........... ....... ........ ......
....... '...'.'. '.'.'.' ....
....... .....'.. ..'.....
.. .......... ..'........
............ ..............
............. '..............
...........'.. .'.'............
............... .'.'.............
.............'.. ..'..'...........
............... .'..............
......... ..............
.....
Environment:
.NET Core 3.1.14
Linux 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020You may also need to include 'linux-arm' in your project's RuntimeIdentifiers.
<RuntimeIdentifiers>linux-arm</RuntimeIdentifiers>
GUIに関しては、
https://codezine.jp/article/corner/606
https://codezine.jp/article/corner/792
Tags: :インフラストラクチャ, :IoT, :Linux, :.NET開発, :.NET Core