linux使用Docker搭建酷Q运行环境

linux使用Docker搭建酷Q运行环境

安装Docker,已安略过

yum -y install docker

service docker start 启动,并查看状态

[root@iz2ze6ezkrxf8bsldl6cn3z tar]# service docker start  ##启动
Redirecting to /bin/systemctl start  docker.service
[root@iz2ze6ezkrxf8bsldl6cn3z tar]# netstat -lnpe|grep docker
unix  2      [ ACC ]     STREAM     LISTENING     3816018  31893/dockerd-curre  /run/docker/libnetwork/492f0054e3c34f4fa6051ebe72ca9b7add1ad67898269f9b407e9a2ba918a416.sock
unix  2      [ ACC ]     STREAM     LISTENING     3815860  31893/dockerd-curre  /var/run/docker.sock
unix  2      [ ACC ]     STREAM     LISTENING     3815879  31899/docker-contai  /var/run/docker/libcontainerd/docker-containerd.sock

如果docker安装出现问题的,请自行google查看更专业的文章

下载coolq镜像文件

[root@iz2ze6ezkrxf8bsldl6cn3z tar]# docker pull coolq/wine-coolq
Using default tag: latest
Trying to pull repository docker.io/coolq/wine-coolq ... 
latest: Pulling from docker.io/coolq/wine-coolq
297061f60c36: Pull complete 
e9ccef17b516: Pull complete 
dbc33716854d: Pull complete 
8fe36b178d25: Pull complete 
.....
Digest: sha256:ebd69fe21650aea4083bc1e4067b0a7fa89c4e28ea9ab7c3663cac296445e8b0
Status: Downloaded newer image for docker.io/coolq/wine-coolq:latest

创建coolq数据存放目录 (此目录自定义位置)

mkdir /data/coolq-data/

运行coolq镜像

docker run --name=coolq --rm -p 对外暴露的端口:9000 -v 刚才创建的目录:/home/user/coolq -e VNC_PASSWD=远程访问密码 -e COOLQ_ACCOUNT=酷Q账号 coolq/wine-coolq

例如我的

docker run --name=coolq --rm -p 8001:9000 -v /data/coolq-data:/home/user/coolq -e VNC_PASSWD=chen19960119 -e COOLQ_ACCOUNT=630389368 coolq/wine-coolq

如果出现以下报错

Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:258: applying cgroup configuration for process caused \"Cannot set property TasksAccounting, or unknown property.\"".

更新yum

yum update -y

重启docker

service docker start
再次执行启动coolq命令
[root@iz2ze6ezkrxf8bsldl6cn3z data]# docker run --name=coolq --rm -p 8001:9000 -v /data/coolq-data:/home/user/coolq -e VNC_PASSWD=chen19960119 -e COOLQ_ACCOUNT=630389368 coolq/wine-coolq
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 010-app: applying... 
[fix-attrs.d] 010-app: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 010-setup-vnc: executing... 
Password:Verify:Would you like to enter a view-only password (y/n)? [cont-init.d] 010-setup-vnc: exited 0.
[cont-init.d] 020-setup-sudo: executing... 
[cont-init.d] 020-setup-sudo: exited 0.
[cont-init.d] 110-get-coolq: executing... 
Downloading CoolQ ...
--2019-08-11 10:42:59--  http://dlsec.cqp.me/cqa-tuling
正在解析主机 dlsec.cqp.me (dlsec.cqp.me)... 117.34.14.64
正在连接 dlsec.cqp.me (dlsec.cqp.me)|117.34.14.64|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
来自 dlsec.cqp.me 的 Cookie 尝试将域设置为 cqp.me
位置://dlcq.cqp.me/cq/CQA-tuling.zip [跟随至新的 URL]
--2019-08-11 10:43:00--  http://dlcq.cqp.me/cq/CQA-tuling.zip
正在解析主机 dlcq.cqp.me (dlcq.cqp.me)... 117.34.14.64
再次使用存在的到 dlsec.cqp.me:80 的连接。
已发出 HTTP 请求,正在等待回应... 200 OK
来自 dlcq.cqp.me 的 Cookie 尝试将域设置为 cqp.me
长度: 1168567 (1.1M) [application/zip]
正在保存至: “/tmp/cq/coolq.zip”

     96% 29.3M 0s
  1100K .......... .......... .......... .......... .         100% 30.0M=0.1s

2019-08-11 10:43:00 (7.57 MB/s) - 已保存 “/tmp/cq/coolq.zip” [1168567/1168567])

Unzipping CoolQ ...
[cont-init.d] 110-get-coolq: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
xauth:  file /home/user/.Xauthority does not exist
WebSocket server settings:
  - Listen on :9001
  - No SSL/TLS support (no cert file)
  - proxying from :9001 to 127.0.0.1:5911

New 'a94a601cf081:11 (user)' desktop is a94a601cf081:11

Creating default startup script /home/user/.vnc/xstartup
Creating default config /home/user/.vnc/config
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/a94a601cf081:11.log

[CQDaemon] Starting CoolQ ....
[CQDaemon] Started CoolQ .
[CQDaemon] CoolQ exited, maybe updated.
[CQDaemon] Searching for the new process ...
[CQDaemon] Found CoolQ process, it's okay.

出现 Started CoolQ 日志,则说明启动成功

如果想后台方式运行,则使用以下命令

[root@iz2ze6ezkrxf8bsldl6cn3z data]# docker run --name=coolq -d -p 8001:9000 -v /data/coolq-data:/home/user/coolq -e VNC_PASSWD=******** -e COOLQ_ACCOUNT=630389368 coolq/wine-coolq
f6796596e69d5c2d6aca858e29a91b06c57f387734e4c837fd0250da4b72fa61

也就是将原命令中的--rm 变为-d。如果返回了一串随机字符,则说明启动成功

docker常用的几条命令

docker logs coolq   ##查看日志/运行状况
docker start coolq  ## 启动coolq
docker stop coolq   ## 通知coolq

连接coolq控制台

http://ip:8001

登录coolq控制台

  • 点击屏幕中央的"链接"
  • 输入你自己设置的密码 (docker命令中设置的密码)
  • 将会看到一个QQ登录页面,输入你自己的QQ账号和密码

这个时候,发送"新手教程"。即可得到回复

coolq环境部署完毕

# java  酷Q 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×