Dotnet Core 3 Runtime on Raspberry Docker

Hi again, after several posts finally we reach the happy end by deploying a dotnet core 3 application to a docker container, running in an arm64 architecture.

Loading...

Since I did not found a simple ready to run docker image, I build one on my own. You can find the Dockerfile on the repository:

https://github.com/exentials/dotnetcore3-docker-arm64

The script will prepare an image based on the very small Alpine distribution with all the necessary libraries to run a dotnet core 3 for arm64 and add the ssh support.

This is only for testing the cross platform ability of the new dotnet framework. It is not the right way to build a docker image, but actually there is no a simple way to create arm64 image on x86/amd64 platform.

However if you want to save time you could just pull the cooked image by my Raspberry Pi, so connect on your docker-berry host and type:

docker run -p 5080:80 -p 2222:22 --name dotnetcore3 --restart always -v dotnet:/var/dotnet -d exentials/dotnetcore3

After a few time the container will be ready for deploying on the persisted /var/dotnet folder by scp or winscp and then start the application by typing on the ssh console:

dotnet /var/dotnet/<YourApplication.dll>

To do a rapid test if you followed my posts, clone from github the DemoEFCore project:

https://github.com/exentials/DemoEFCore.git

after that build and publish it with:

dotnet publish

Inside the bin/debug/netcoreapp3.0/publish folder you find the result.

Than copy the publish folder on the volume of the dotnet container.

I have added a command line option to the project so you can change the start parameters.

Due the fact that you must point to the internal docker network, find the IP address of the PostgreSQL container (172.16.0.2 at the moment in my case)

type the command like:

dotnet /var/dotnet/publish/DemoEFCore.dll --db-host 172.16.0.2

If all run without exceptions you will see the output as below:

Check also with pgAdmin the created database results.

That’s all!

Loading...

Add Your Comment

* Indicates Required Field

Your email address will not be published.

*