实、实验报告......

烁灵 posted @ 2015年1月20日 14:59 in Linux with tags docker quick-server(cocos) , 3834 阅读
TAT以下是折腾docker折腾quick-server0.4.0的经历,而非过程
 
 
查看镜像:
docker@boot2docker:~$ docker images
 
运行镜像并进到bash模式,映射8080端口到宿主50002端口:
docker@boot2docker:~$ docker run -t -i -p 50002:8080 chukong/quick-server:0.4.0
 
关闭镜像并保存:
记下当前id: |root@ID| ←
|root@ID| exit
docker@boot2docker:~$ docker commit ID chukong/quick-server:0.4.0
 
开启ssh后台运行镜像:
docker@boot2docker:~$ docker run -d -p 50003:22 chukong/quick-server:0.4.0 /usr/sbin/sshd -D
 
创建用户sure52:
|root@ID| useradd sure52
|root@ID| passwd sure52
 
建立git仓库:
|root@ID| cd /home/sure52
|root@ID| mkdir qs_code
|root@ID| chmod o+w -R qs_code
|root@ID| cd qs_code
|root@ID| git init
|root@ID| vim README.md
|root@ID| git add "."
|root@ID| git commit -m "base version"

|root@ID| git remote add origin ssh://sure52@127.0.0.1/home/sure52/qs_code/.git
|root@ID| git push origin
|root@ID| git remote show origin
 
测试git仓库
E:\> git clone ssh://sure52@192.168.59.103:50003/home/sure52/qs_code/.git
 
push 无写权限remote: fatal: failed to write object解决:
|root@ID| chmod -R 777 .git
 
push master -> master (branch is currently checked out)出错解决:
|root@ID| cd .git
|root@ID| vi config
    添加:    
       [receive]
       denyCurrentBranch = ignore
 
Quick-Server取session_id:
curl "http://192.168.59.103:50002/_server/user/session/?id=sure52"
 
提交usercode:
    本地路径结构:
    module1/actions/SayHello.lua
    提交至
    /home/sure52/qs_code/module1/actions/Sayhello.lua
    实际运行时
    /opt/qs/openresty/server/user_codes/module1/actions/SayHello.lua
    config.lua配置:
userDefinedCodes = {
	luaRepoPrefix = "server.user_codes",
	localRepo  = "/home/sure52/qs_code/",
	localDest  = "/opt/qs/openresty/server/user_codes",
	--localRepo = "/home/cheeray/work/user_codes",
	--localDest = "/home/cheeray/work/quick-server/src/server/user_codes",
	uriPrefix  = {
		module1 = "http_test1",
		module2 = "http_test2",
	},
},
    运行命令:
curl "http://192.168.59.103:50002/_Server/user/uploadcodes?commit=f54ab5e0ddd0d93b55ae4f9169c25caf52a88392&session_id=f56b3cb7fc96dfb25e501c56e8f9b057"
 
sayHello:
curl "http://192.168.59.103:50002/http_test1/Say/SayHello?session_id=f56b3cb7fc96dfb25e501c56e8f9b057&name=a_name"
 
因为用的是坑爹windows……
让本机localhost:8088能直接连到容器内:(windows 127.0.0.1:8088->docker虚拟机192.168.59.103:50002->容器内x.x.x.x:8088)
    在virtual box中做本机端口映射
        VM -> 设置 -> 网络 -> 网卡1 -> 端口转发 添加
        名称任意 协议:TCP 主机IP:127.0.0.1 主机端口:8088 子系统IP不填 子系统端口:50002
 
参考:
    http://www.cnblogs.com/bjfuouyang/p/3798421.html
 
 
Avatar_small
sana 说:
2019年2月01日 05:16

Another great selection of <a href="https://islamabad-escorts69.tumblr.com/">Islamabad escorts</a> we provide are mature married women who are basically housewives sitting around doing nothing at home and looking for excessive income to cover their daily expenses or those who are not happy with their husbands and husbands. want to have something else Private fun out and get paid for it. <a href="https://islamabad-escorts69.tumblr.com/">islamabad-escorts69.tumblr.com</a> is simply excellent and plans to have your services again.

Avatar_small
Mitchell Fosbrook 说:
2019年5月02日 18:41

This is a very helpful share from users can get better help in learning of right way of proper coding in effective way. People like to read latest zipjob resume review for learning of professional CV writing works.

Avatar_small
cleaning services in 说:
2019年9月17日 21:54

Well before jumping with the house maintaining services company’s tip, let all of us suggest you a fun way for you to exercise and lay aside some money in addition! A go through indicated that your chosen regular man or woman could use up 200 to help you 260 calories at least an hour doing home cleaning! So, let’s start the best tip designed for saving as a result of doing the various houses maintaining alone, and use up some calories to provide a reward!

Avatar_small
defend your nuts 说:
2019年10月07日 10:50

After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think. Thanks for your words and allowing me to commenting!

Avatar_small
wanamassa reale stat 说:
2019年11月15日 00:47

If you are searching for a inkjet printer to printing labels, then you're bound to obtain confused effortlessly due to the choices which are available for sale. There really are a different number of printers which are used in order to print labeling, you require some tips to obtain the best Content label printer based on your necessity.

Avatar_small
pr home school 说:
2020年3月21日 22:05

Start with thinking about your situation. Are you prepared buy home? How much how can you afford in any monthly home owner loan payment? How a lot of space do you really require? What sections of town do you really like? As you answer such questions, develop a "To Do" list it's essential to doing laid back research on the subject of property. Talk to loved ones, drive throughout neighborhoods, and peruse in typically the "Homes" a natural part of the rag, Foreclosure Prices, and internet search.

Avatar_small
mv home inspections 说:
2020年3月21日 22:06

Home inspection, for the reason that defined, happens to be an examination of this physical arrangement and systems from a home, which supplies a detailed 'snapshot' of the condition of the home for the duration of the examination. The reason for a residential inspection is to help reduce some of this risk in the middle of purchasing home; however, it again cannot take away those negative aspects, nor are able to the inspector expect future happenings or alters in performance owing to changes drank or occupancy.

Avatar_small
uk cleaning director 说:
2020年3月21日 22:06

Anybody can see the comfort from a clean not to mention well held on to home. Home cleaning can be described as necessity a lot of people are unable to keep their residence cleans due to their fast paced schedules. Homes could be cleaned regularly as a way for unpleasant odors and vermin infestations to always be prevented.

Avatar_small
maids in dubai 说:
2020年4月29日 17:58

Whenever you hire the servant maid to wash you house or office, you tend to be permitting her to get into to your individual belongings. Therefore before signing up a cleaning service, you ought to ask particular questions to discover more about her history information as well as personal testimonials. First point is which, you ought to inquire your pals, relatives or even acquaintances for his or her personal experience using the servant service personnel.

Avatar_small
painters in Dubai 说:
2020年4月29日 17:58

If you wish to give your house a certain kind of atmosphere, then inside paints are extremely important. The paints that you simply choose will offer you either warmness or coolness towards the rooms of your house and if you want to paint your self or employ house artists; keep in your mind that we now have many ideas that you should consider. These suggestions include selecting things like the right fresh paint, colors, tones, schemes, colour methods, along with related elements.

Avatar_small
ali 说:
2021年1月26日 15:24 Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... บุหรี่ไฟฟ้า
Avatar_small
ali 说:
2021年2月08日 21:37

It is very good, but look at the information at this address. 그래프사이트

Avatar_small
webpage 说:
2021年3月26日 00:25

You will find on these online casinos a wide range of games of all kinds, provided you choose a reliable casino that allows you to have opportunities to collect winnings, what to combine the useful with the pleasant.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter