Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Asp.Net 5 dev environment docker image

If you are using Linux/Mac and want to try out Asp.Net 5 (vNext), this image is for you.

It is based on Microsoft's office image: microsoft/aspnet, with an additional minimal daemon script.

How to run Asp.Net app with this image

  1. Generate the project scaffold

    I use yeoman to generate the project, search for generator aspnet

    $ npm install -g yo
    $ yo aspnet:app
    
  2. Start a docker container as development environment

    Pull this image, I use boot2docker on my Mac:

    $ docker pull txchen/aspnet5dev
    

    Suppose your generated project's path is /path/to/aspnetproject, start a new container as daemon:

    $ docker run -d -p 5004:5004 --name=aspnet5dev \
     -v /path/to/aspnetproject:/code \
     txchen/aspnet5dev
    
  3. Enter the container and launch the app

    Now, let's enter the docker container, by using docker 1.3's new feature - exec:

    $ docker exec -it aspnet5dev
    

    Go to the project folder, and launch it:

    $ cd /code
    $ kvm restore
    $ k kestrel
    
  4. View in browser

    The yeoman generated project defines the command in project.json, the port for kestrel command is 5004.

    If you are using boot2docker, you need to get the boot2docker VM's IP.

    If you are using docker in Linux, localhost is enough

    # if using boot2docker
    $ boot2docker ip
    # Then open http://ip:5004 in browser
    

    Woot! Asp.Net app running in kestrel/docker/linux!

Dockerhub link

https://registry.hub.docker.com/u/txchen/aspnet5dev/

To build the image

docker build --rm -t txchen/aspnet5dev .
Docker Pull Command
Owner
txchen
Source Repository

Comments (0)