Skip to content

Commit a053ece

Browse files
committed
Merge pull request #537 from tlk/dev
Add Dockerfiles and improve instructions on how to use the ASP.NET Docker image
2 parents 99fde4b + 1dd1411 commit a053ece

File tree

3 files changed

+68
-6
lines changed

3 files changed

+68
-6
lines changed

GettingStartedDeb.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
1+
2+
# Getting started with ASP.NET 5 and Docker
3+
4+
It is possible to run the sample apps using [Docker](https://www.docker.com/) and the [ASP.NET 5 Preview Docker Image](https://registry.hub.docker.com/u/microsoft/aspnet/).
5+
6+
### Get the source code
7+
```
8+
git clone [email protected]:aspnet/Home.git aspnet-home
9+
cd aspnet-home/samples/latest/HelloWeb
10+
```
11+
12+
### Build a docker image
13+
```
14+
docker build -t aspnet-home-helloweb .
15+
```
16+
17+
### Run a docker container
18+
```
19+
docker run -it -p 5004:5004 aspnet-home-helloweb
20+
```
21+
22+
### See the HelloWeb sample in action
23+
The URL to the sample app depends on how you are running Docker.
24+
25+
If you are using [boot2docker](https://github.com/boot2docker/boot2docker):
26+
27+
```
28+
open http://$(boot2docker ip):5004
29+
```
30+
31+
Otherwise, you can access the sample app directly on localhost:
32+
33+
```
34+
open http://localhost:5004
35+
```
36+
37+
### Stop the container
38+
You can stop the docker container by pressing <kbd>Enter</kbd> in the console, or by using ```docker ps``` to identify the container id followed by ```docker stop <container id>```.
39+
40+
41+
### Learn more
42+
Detailed instructions on how to use the [ASP.NET 5 Preview Docker Image](https://registry.hub.docker.com/u/microsoft/aspnet/) can be found on http://blogs.msdn.com/b/webdev/archive/2015/01/14/running-asp-net-5-applications-in-linux-containers-with-docker.aspx. Please note that the ```kpm``` and ```k``` tools have been renamed since that article was published.
43+
44+
45+
46+
# Getting started with ASP.NET 5 and Linux
47+
148
> Tested on: Ubuntu 14.04, Mint 17.01
249
50+
This section deals with setting up a machine to run applications without the Docker image.
51+
352
As with all other operating systems you need DNVM to get going with ASP.NET 5. To get it you run `curl` to download a `.sh` file and then run it. To configure a Linux machine to run an ASP.NET 5 application use the following instructions.
453

554
The steps to set up a Linux machine are:
@@ -9,11 +58,6 @@ The steps to set up a Linux machine are:
958
* Get DNVM
1059
* Add sources to NuGet.config (For package restore)
1160

12-
### Docker
13-
14-
Instructions on how to use the ASP.NET [Docker](https://www.docker.com/) image here: http://blogs.msdn.com/b/webdev/archive/2015/01/14/running-asp-net-5-applications-in-linux-containers-with-docker.aspx
15-
16-
The rest of this section deals with setting up a machine to run applications without the Docker image.
1761

1862
### Get Mono
1963

@@ -59,7 +103,7 @@ curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX
59103

60104
Once this step is complete you should be able to run `dnvm` and see some help text.
61105

62-
# Add Sources to NuGet.config
106+
### Add Sources to NuGet.config
63107

64108
Now that we have DNVM and the other tools needed to run an ASP.NET application we need to add the development configuration sources to get nightly builds of all the ASP.NET packages.
65109

samples/latest/HelloMvc/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM microsoft/aspnet
2+
3+
COPY project.json /app/
4+
WORKDIR /app
5+
RUN ["dnu", "restore"]
6+
COPY . /app
7+
8+
EXPOSE 5004
9+
ENTRYPOINT ["dnx", "project.json", "kestrel"]

samples/latest/HelloWeb/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM microsoft/aspnet
2+
3+
COPY project.json /app/
4+
WORKDIR /app
5+
RUN ["dnu", "restore"]
6+
COPY . /app
7+
8+
EXPOSE 5004
9+
ENTRYPOINT ["dnx", "project.json", "kestrel"]

0 commit comments

Comments
 (0)