2016年7月4日星期一

Created an non-root docker image for .NET Core 1.0 so you no worry about yemon or npm's anti-root problem

When use the docker image of .NET Core 1.0 from microsoft/dotnet, have you ever encountered `permission denied '/root/.config/configstore/.....` or `No native-sleep available` or `NuGet Cache` error or some weird problem concerned with file permission about /usr/local?
That's why i build a docker image.

Dockerfile is here. I have pushed to docker hub as osexp2000/dnetcore_docker_image.

dnetcore_docker_image

An non-root docker image for .NET Core development( having created normal user id with sudoable, installed nodejs, yeoman, aspnet generator...), you won't worry about yeomen's anti-root problem and some other permission problem about /usr/local.
Usage:
To just use the docker image:
docker run -it osexp2000/dnetcore_docker_image
You will get a bash running with normal user id named dev_user which can sudo without password.
Then you can run aspnet generator:
yo aspnet
And also installed some other utilities vim,lsofnetstat.
A screenshot:
$ docker run -it osexp2000/dnetcore_docker_image
dev_user@640be8c28a81:~$ id
uid=1000(dev_user) gid=1000(dev_user) groups=1000(dev_user),27(sudo)
dev_user@640be8c28a81:~$ yo aspnet
? ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== Yes

     _-----_     ╭──────────────────────────╮
    |       |    │      Welcome to the      │
    |--(o)--|    │  marvellous ASP.NET Core │
   `---------´   │        generator!        │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

? What type of application do you want to create? (Use arrow keys)
❯ Empty Web Application
  Console Application
  Web Application
  Web Application Basic [without Membership and Authorization]
  Web API Application
  Class Library
  Unit test project (xUnit.net)

To build it yourself:
docker build -t IMAGE_NAME_HERE --rm https://raw.githubusercontent.com/sjitech/dnetcore_docker_image/master/Dockerfile
or download the Dockerfile then run:
docker build -t IMAGE_NAME_HERE --rm - < Dockerfile

没有评论:

发表评论