├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM resin/rpi-raspbian:jessie 2 | 3 | #Based on original mono & aspnet docker files 4 | 5 | RUN apt-get update \ 6 | && apt-get install -y curl \ 7 | && rm -rf /var/lib/apt/lists/* 8 | 9 | RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 10 | 11 | RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.2.2.30 main" > /etc/apt/sources.list.d/mono-xamarin.list \ 12 | && apt-get update \ 13 | && apt-get install -y mono-devel ca-certificates-mono fsharp mono-vbnc nuget \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | ENV DNX_VERSION 1.0.0-rc1-update1 17 | ENV DNX_USER_HOME /opt/dnx 18 | #Currently the CLR packages don't have runtime ids to handle debian:jessie but 19 | #we are making sure that the dependencies are the right versions and are opting for 20 | #the smaller base image. So we use this variable to overwrite the default detection. 21 | ENV DNX_RUNTIME_ID ubuntu.14.04-x64 22 | 23 | # In order to address an issue with running a sqlite3 database on aspnet-docker-linux 24 | # a version of sqlite3 must be installed that is greater than or equal to 3.7.15 25 | # which is not available on the default apt sources list in this image. 26 | # ref: https://github.com/aspnet/EntityFramework/issues/3089 27 | # https://github.com/aspnet/aspnet-docker/issues/121 28 | RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list 29 | 30 | # added sqlite3 & libsqlite3-dev install for use with aspnet-generators (Entity framework) 31 | RUN apt-get -qq update && apt-get -qqy install unzip libc6-dev libicu-dev sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* 32 | 33 | RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_USER_HOME=$DNX_USER_HOME DNX_BRANCH=v$DNX_VERSION sh 34 | RUN bash -c "source $DNX_USER_HOME/dnvm/dnvm.sh \ 35 | && dnvm install $DNX_VERSION -alias default \ 36 | && dnvm alias default | xargs -i ln -s $DNX_USER_HOME/runtimes/{} $DNX_USER_HOME/runtimes/default" 37 | 38 | # Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old) 39 | # Combining this with the uninstall and purge will save us the space of the build tools in the image 40 | RUN LIBUV_VERSION=1.4.2 \ 41 | && apt-get -qq update \ 42 | && apt-get -qqy install autoconf automake build-essential libtool \ 43 | && curl -sSL https://github.com/libuv/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \ 44 | && cd /usr/local/src/libuv-$LIBUV_VERSION \ 45 | && sh autogen.sh && ./configure && make && make install \ 46 | && rm -rf /usr/local/src/libuv-$LIBUV_VERSION \ 47 | && ldconfig \ 48 | && apt-get -y purge autoconf automake build-essential libtool \ 49 | && apt-get -y autoremove \ 50 | && apt-get -y clean \ 51 | && rm -rf /var/lib/apt/lists/* 52 | 53 | ENV PATH $PATH:$DNX_USER_HOME/runtimes/default/bin 54 | 55 | # Prevent `dnu restore` from stalling (gh#63, gh#80) 56 | ENV MONO_THREADS_PER_CPU 50 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 RootDevelop 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rpi-aspnetcore 2 | Raspberry PI docker image for ASP.Net Core (Mono based) 3 | 4 | This allows you to run ASP.NET Core web applications on your Raspberry Pi with Docker. 5 | 6 | ## Setup Docker with ASP.NET Core on your Raspberry Pi 7 | 8 | 1. Download the latest Hypriot image at http://blog.hypriot.com/downloads/ 9 | 2. Write this image to your SD card 10 | 3. Login to your pi with default pi credentials 11 | 4. Clone your ASP.NET core web application to any directory 12 | 5. Edit your Dockerfile to use **rootdevelop/rpi-aspnetcore:latest** as FROM image 13 | 6. Build your docker file ("docker build -t myrepo/myappname:0.1 .") 14 | 7. Run your ASP.NET application in Docker & Enjoy! 15 | 16 | Thanks. Any questions. Let me know! 17 | --------------------------------------------------------------------------------