博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
.NET Core 1.0学习(3)-做了个靠谱点的docker image)
阅读量:7004 次
发布时间:2019-06-27

本文共 2617 字,大约阅读时间需要 8 分钟。

hot3.png

碰到的错误就是那permission denied '/root/.config/configstore/insight-yo.yml'呀,Native thread-sleep not availableNuGet cache之类的错误。前者是yeomon的,后者是nodejs安装的不够新(apt-get install nodejs的是0.10级别的版本,谁想的到啊)

做好的docker image叫 。

docker run -it osexp2000/dnetcore-docker-image

进去之后就是bash,以devuser用户运行在/home/devuser,这个用户能够sudo(无需密码)。

进去就可以顺利的运行aspnet模版生成工具yeomen了。

yo aspnet

里面什么npm和yeomen之类的东西都准备好了,甚至基本的vim,lsofnetstat之类的都准备好了,不然真不方便查看环境。

运行的样子是这样的:

$ docker run -it osexp2000/dnetcore-docker-imagedevuser@640be8c28a81:~$ iduid=1000(devuser) gid=1000(devuser) groups=1000(devuser),27(sudo)devuser@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)

Dockerfile放在了。很少,干脆贴下来。

FROM microsoft/dotnetRUN apt-get updateRUN apt-get install -y apt-utils#add developer user and switch to itRUN apt-get install -y sudoRUN adduser --disabled-password --gecos "Developer" devuserRUN adduser devuser sudoRUN echo "devuser ALL=(ALL:ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)RUN chown -R root:sudo /usr/local #this is also important so some tools like yoemen will not complainsUSER devuserWORKDIR /home/devuser#these are basic utilitiesRUN sudo apt-get install -y bash-completion vim less manRUN sudo apt-get install -y lsof tree psmiscRUN sudo apt-get install -y net-tools iputils-ping netcat curl wget#install nodejs 6.xRUN curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -RUN sudo apt-get install -y nodejs#install aspnet generatorRUN sudo npm install -g yo bower grunt-cli gulpRUN sudo npm install -g generator-aspnetRUN sudo rm -f /coreRUN sudo rm -fr /tmp/NuGetScratch

可以自己存起来build成docker image

docker build -t IMAGE_NAME_HERE --rm - < Dockerfile

下次再沿着继续学。不过我想看看如何通过Mac OS X里的Visual Studio Code来直接把代码发布到docker里。

转载于:https://my.oschina.net/osexp2003/blog/705944

你可能感兴趣的文章
学习推荐系统概况
查看>>
Linux系统进程管理
查看>>
zabbix数据库优化之apache优化(四)
查看>>
mysql日期加减<转>
查看>>
文件管理
查看>>
Fastjson反序列化漏洞研究
查看>>
Cgroup blkio I/O 控制
查看>>
简单的RAID模拟
查看>>
Zabbix3.0安装(基于Ubuntu14.04)
查看>>
JDK8安装程序重大bug
查看>>
CentOS7/RHEL7安装Redis
查看>>
FTP服务器-vsftp pam mysql
查看>>
Linux NAT基本流程与实现技巧
查看>>
Java流程控制语句—(下)
查看>>
配置帧中继子接口和流量整形
查看>>
Android官方开发文档Training系列课程中文版:手势处理之拖拽或缩放
查看>>
AD------权限分配---AGDLP原则
查看>>
SCCM2012升级SP1系列之部署SCCM2012④部署SCCM2012主站点
查看>>
使用已有的私钥进行GitHub验证
查看>>
SQL中几个常用的排序函数
查看>>