免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
docker? ?NodeJs? ?NodeJS? ? server.js package.json Dockerfi le .dockerignore ?server.js? ?package.json? mkdir docker_demo cd docker_demo touch server.js touch package.json touch Dockerfile touch .dockerignore 1 2 3 4 5 6 const Koa = require(koa); const app = new Koa(); app.use(async ctx = ctx.body = Hello docker; ); app.listen(3000); 1 2 3 4 5 6 7 8 ? ?,?demo? ?dockerfi le? Dockerfi le?Dockerfi le?image? ?Docker?docker build?Dockerfi le?image. ?.dockerignore? ?git?.gitignore name: docker_demo, version: 0.1.0, private: true, scripts: start: node server.js , dependencies: koa: 2.5.0 1 2 3 4 5 6 7 8 9 10 11 npm start1 # Logs logs *.log npm-debug.log* # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ?Dockerfi le? ? coverage # nyc test coverage .nyc_output # Grunt intermediate storage ( plugins#storing-task-files) .grunt # node-waf configuration .lock-wscript # Compiled binary addons (/api/addons.html) build/Release # Dependency directories node_modules jspm_packages # Optional npm cache directory .npm # Optional REPL history .node_repl_history .idea .node_modules node_modules .vscode 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 #?node? FROM node:8.9-alpine #? MAINTAINER evilboy #?app? ADD . /app/ #?app?cd WORKDIR /app #? RUN npm install #? EXPOSE 3000 #? CMD npm, start 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ?build?,?“.”? ? images? ?images?images? rootSandbox-N # docker build -t docker_demo . Sending build context to Docker daemon 39.94kB Step 1/7 : FROM node:8.9-alpine - 406f227b21f5 Step 2/7 : MAINTAINER robin - Using cache - 78d6cdbcfee2 Step 3/7 : ADD . /app/ - 2cb30678612d Step 4/7 : WORKDIR /app Removing intermediate container e51377081039 - c2b7d0f37d2d Step 5/7 : RUN npm install - Running in da0c3946ca8d npm notice created a lockfile as package-lock.json. You should commit this file. added 38 packages in 3.323s Removing intermediate container da0c3946ca8d - eecee87f10e2 Step 6/7 : EXPOSE 3000 - Running in f3973cc168a4 Removing intermediate container f3973cc168a4 - 2671a4c6deb4 Step 7/7 : CMD npm, start - Running in dec529f754aa Removing intermediate container dec529f754aa - 6ec73793d353 Successfully built 6ec73793d353 Successfully tagged docker_demo:latest 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #? -
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 妊娠期梅毒母婴传播的阻断策略与效果
- 车间安全员试题及答案
- 妇幼健康与老龄化社会应对策略
- 女性职业人群专项体检项目设计
- 大数据在职业暴露评价中的整合
- 大数据分析驱动医疗纠纷精准预防策略-1
- 法律形成性考试及答案
- 听力考试山东题目及答案
- 2025年高职第一学年(模具设计与制造)模具CAM阶段测试题及答案
- 2026年岗位能力综合测试(岗位适配性评估)试题及答案
- 广东省深圳市龙华区2024-2025学年七年级上学期期末历史试题(含答案)
- 面部刮痧教学课件
- 2023北京丰台高一(上)期末英语试卷含答案
- GB∕T 20973-2020 膨润土-行业标准
- 妇幼保健院工作制度(岗位职责252项)
- 尽调模范:浑水做空瑞幸的报告(中文版)
- 燃气管道年度检验报告
- (完整版)外研版英语初二下册单词表
- 口腔扁平苔藓PPT医学课件
- 《设计概论》教案2022
- 某铸造厂总降压变电所及厂区配电系统设计
评论
0/150
提交评论