Repository navigation
docker_node
Public
About
docker部署node实践
Resources
Readme
MIT license
Activity
Custom properties
Stars
1 star
Watchers
3 watching
Forks
0 forks
Report repository
Branches
Tags
Go to Branches page Go to Tags page
Latest commit
History
24 Commits
View commit history for this file.
Folders and files
Repository files navigation
docker_node
docker部署node实践
测试css
docker 是client+host的结构,其中host只能运行在linux内核中,在oxs上安装需要有虚拟机来运行这个host实例。应该也可以指定远程host,指定完成以后docker就能search、pull镜像了。
- 第一步,安装osx docker,似乎比较麻烦。[使用proxychains+socks5能搞定]
- 第二步,安装DockerToolbox,安装失败,本地需要起一个docker服务,macos【linux能直接运行】需要起一个vm来运行host服务,已安装boot2docker。boot2docker init目前执行失败,尝试用proxychains来代理下载,明天试试vpn。
- 第一步,从daocloud 下载Docker ToolBox。安装完成以后可以使用(已经自带了vm和镜像)。
- 第二步,找一个node环境的docker镜像,执行docker search node, 发现第一个node镜像,执行docker pull node,把镜像拖到本地。
- 第三步,运行docker,
docker run -i -t node /bin/bash。
- 第四步,[在镜像环境中]拿到的是一个ubuntu的裸系统+node环境,先更新,执行apt-get update。
- 第五步,[在镜像环境中]apt-get install vim。
- 第六步,[在镜像外]docker commit af12a9781d1f node_and_vim,形成一个自己的镜像,该镜像同时带有node和vim;在docker images中查看。
- 第七步,在docker镜像中手写一个简单的node-httpserver,见文件server.js。
- 第八步,docker run -p 3000:3003 -d server /usr/local/bin/node /opt/www/server.js ,运行一个image并运行在后台完成端口3003到3000的映射。
- 第九步,docker image中写好启动脚本,普通的shell脚本,做一些环境准备等等;
- 第十步,在项目中增加nginx负载均衡配置,并测试nginx+docker负载均衡可用;
TODO:
- 测试并发、对比单独的http-server的并发、对比nginx+pm2的并发;
- 提升部署效率,评估是否可以推广;
- 使用监控宝监控docker运行状态;
- 研究《Docker容器与容器云》浙大SEL实验室的书;
- Rreact.js 开发前端组件并研究与docker分布式系统的组合使用(避免冲突,目前觉得冲突可能性小,分布与前端组件没有直接关系,可以总结一些适用于分布式系统的组件设计)。
About
docker部署node实践
Resources
Readme
MIT license
Activity
Custom properties
Stars
1 star
Watchers
3 watching
Forks
0 forks
Report repository
Releases
Packages
Contributors
Languages