Skip to content

Instantly share code, notes, and snippets.

@richardkiene
Created June 16, 2015 02:16
Show Gist options
  • Save richardkiene/2c9349e5c9bcb2c1cb02 to your computer and use it in GitHub Desktop.
Save richardkiene/2c9349e5c9bcb2c1cb02 to your computer and use it in GitHub Desktop.
Dockerfile for creating an ASP.NET 5 CoreCLR app running in an lx-branded zone
FROM ubuntu:14.04
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update && apt-get install -y libunwind8 libssl-dev curl unzip libtool automake build-essential
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
RUN apt-get update
RUN apt-get install -y mono-complete
RUN mozroots --import --sync
RUN apt-get install automake libtool curl
RUN curl -L https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/src \
&& cd /usr/local/src/libuv-1.4.2 \
&& sh autogen.sh && ./configure && make && make install \
&& rm -rf /usr/local/src/libuv-1.4.2 \
&& ldconfig
ENV DNX_VERSION latest
ENV DNX_USER_HOME /opt/dnx
ENV DNX_FEED https://www.myget.org/F/aspnetvnext/api/v2
RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_USER_HOME=$DNX_USER_HOME DNX_BRANCH=v$DNX_VERSION sh
RUN bash -c "source $DNX_USER_HOME/dnvm/dnvm.sh \
&& dnvm upgrade -u \
&& dnvm install $DNX_VERSION -r coreclr -a coreclr -u \
&& dnvm install $DNX_VERSION -r mono -a mono -u \
&& dnvm alias coreclr | xargs -i ln -s $DNX_USER_HOME/runtimes/{} $DNX_USER_HOME/runtimes/coreclr \
&& dnvm alias mono | xargs -i ln -s $DNX_USER_HOME/runtimes/{} $DNX_USER_HOME/runtimes/mono \
&& dnvm use mono"
ENV MONO_ENV_OPTIONS --gc=boehm
ENV PATH $PATH:$DNX_USER_HOME/runtimes/coreclr/bin
COPY . /app
WORKDIR /app
RUN mv NuGet.Config /.
RUN $DNX_USER_HOME/runtimes/mono/bin/dnu restore
RUN bash -c "source $DNX_USER_HOME/dnvm/dnvm.sh && dnvm use coreclr && dnvm list"
WORKDIR /app
EXPOSE 5004
ENTRYPOINT $DNX_USER_HOME/runtimes/coreclr/bin/dnx /app kestrel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment