Skip to content

Update Dockerfile calling syntax #948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions samples/latest/HelloMvc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
FROM microsoft/aspnet
FROM ubuntu:14.04

COPY project.json /app/
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --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

ENV DNX_USER_HOME /opt/dnx

RUN apt-get -qq update && apt-get -qqy install curl unzip mono-complete

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 alias default | xargs -i ln -s $DNX_USER_HOME/runtimes/{} $DNX_USER_HOME/runtimes/default"

# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)
RUN apt-get -qqy install \
autoconf \
automake \
build-essential \
libtool

RUN LIBUV_VERSION=1.4.2 \
&& curl -sSL https://github.com/libuv/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \
&& cd /usr/local/src/libuv-$LIBUV_VERSION \
&& sh autogen.sh && ./configure && make && make install \
&& rm -rf /usr/local/src/libuv-$LIBUV_VERSION \
&& ldconfig

ENV PATH $PATH:$DNX_USER_HOME/runtimes/default/bin

ENV MONO_THREADS_PER_CPU 20

COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
COPY . /app

EXPOSE 5004
ENTRYPOINT ["dnx", "project.json", "kestrel"]
ENTRYPOINT ["dnx", "kestrel"]
8 changes: 8 additions & 0 deletions samples/latest/HelloMvc/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGetorg" value="https://nuget.org/api/v2/" />
</packageSources>
</configuration>
37 changes: 33 additions & 4 deletions samples/latest/HelloWeb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
FROM microsoft/aspnet
FROM ubuntu:14.04

COPY project.json /app/
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --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

ENV DNX_USER_HOME /opt/dnx

RUN apt-get -qq update && apt-get -qqy install curl unzip mono-complete

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 alias default | xargs -i ln -s $DNX_USER_HOME/runtimes/{} $DNX_USER_HOME/runtimes/default"

# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)
RUN apt-get -qqy install \
autoconf \
automake \
build-essential \
libtool

RUN LIBUV_VERSION=1.4.2 \
&& curl -sSL https://github.com/libuv/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \
&& cd /usr/local/src/libuv-$LIBUV_VERSION \
&& sh autogen.sh && ./configure && make && make install \
&& rm -rf /usr/local/src/libuv-$LIBUV_VERSION \
&& ldconfig

ENV PATH $PATH:$DNX_USER_HOME/runtimes/default/bin

ENV MONO_THREADS_PER_CPU 20

COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
COPY . /app

EXPOSE 5004
ENTRYPOINT ["dnx", "project.json", "kestrel"]
ENTRYPOINT ["dnx", "kestrel"]
8 changes: 8 additions & 0 deletions samples/latest/HelloWeb/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="NuGetorg" value="https://nuget.org/api/v2/" />
</packageSources>
</configuration>