{"action":"created","issue":{"url":"https://api.github.com/repos/jumpserver/jumpserver/issues/1749","repository_url":"https://api.github.com/repos/jumpserver/jumpserver","labels_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/1749/labels{/name}","comments_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/1749/comments","events_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/1749/events","html_url":"https://github.com/jumpserver/jumpserver/issues/1749","id":354273481,"node_id":"MDU6SXNzdWUzNTQyNzM0ODE=","number":1749,"title":"coco启动报错","user":{"login":"bruce-zu","id":40290262,"node_id":"MDQ6VXNlcjQwMjkwMjYy","avatar_url":"https://avatars1.githubusercontent.com/u/40290262?v=4","gravatar_id":"","url":"https://api.github.com/users/bruce-zu","html_url":"https://github.com/bruce-zu","followers_url":"https://api.github.com/users/bruce-zu/followers","following_url":"https://api.github.com/users/bruce-zu/following{/other_user}","gists_url":"https://api.github.com/users/bruce-zu/gists{/gist_id}","starred_url":"https://api.github.com/users/bruce-zu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruce-zu/subscriptions","organizations_url":"https://api.github.com/users/bruce-zu/orgs","repos_url":"https://api.github.com/users/bruce-zu/repos","events_url":"https://api.github.com/users/bruce-zu/events{/privacy}","received_events_url":"https://api.github.com/users/bruce-zu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-27T10:59:12Z","updated_at":"2018-08-30T02:00:06Z","closed_at":null,"author_association":"NONE","body":"[简述你的问题]\r\n\r\n##### 使用版本\r\njump 1.0.0\r\n\r\n##### 问题复现步骤\r\n1. jumpserver是用docker安装\r\n2. coco安装完成后，使用./cocod start 启动报错：\r\n\r\n [service ERROR] Failed register terminal Response json couldn't be decode:\r\n\r\n\r\n##### 具体表现[截图可能会更好些,最好能截全]\r\n\r\n\r\n##### 其他\r\n\r\n\r\n[注:] 完成后请关闭 issue\r\n"},"comment":{"url":"https://api.github.com/repos/jumpserver/jumpserver/issues/comments/417164529","html_url":"https://github.com/jumpserver/jumpserver/issues/1749#issuecomment-417164529","issue_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/1749","id":417164529,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzE2NDUyOQ==","user":{"login":"xiaobei-ihmhny","id":26052371,"node_id":"MDQ6VXNlcjI2MDUyMzcx","avatar_url":"https://avatars3.githubusercontent.com/u/26052371?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaobei-ihmhny","html_url":"https://github.com/xiaobei-ihmhny","followers_url":"https://api.github.com/users/xiaobei-ihmhny/followers","following_url":"https://api.github.com/users/xiaobei-ihmhny/following{/other_user}","gists_url":"https://api.github.com/users/xiaobei-ihmhny/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaobei-ihmhny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaobei-ihmhny/subscriptions","organizations_url":"https://api.github.com/users/xiaobei-ihmhny/orgs","repos_url":"https://api.github.com/users/xiaobei-ihmhny/repos","events_url":"https://api.github.com/users/xiaobei-ihmhny/events{/privacy}","received_events_url":"https://api.github.com/users/xiaobei-ihmhny/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T02:00:06Z","updated_at":"2018-08-30T02:00:06Z","author_association":"NONE","body":"请问，能给指导一下吗？这个问题困扰我好几天了，非常感谢！！\r\n下面是我的Dockerfile\r\n\r\n```\r\n# pull down centos image\r\n# 指定所创建镜像的基础镜像\r\n# 最好把相关镜像下载到本地\r\nFROM centos:7.3.1611\r\n# 指定维护者信息\r\nMAINTAINER ihmhny \"xiaobei-ihmhny@163.com\"\r\nWORKDIR /opt\r\n# 0. 安装相关依赖\r\nRUN yum update -y && yum -y install wget sqlite-devel xz gcc gcc-c++ automake zlib-devel openssl-devel epel-release git libtool make\r\nWORKDIR /opt/\r\n# 1. 指定环境变量，\r\nENV COCO_SERVER_ADDR= \\\r\n    COCO_SERVER_PORT= \\\r\n    GUACAMOLE_SERVER_ADDR= \\\r\n    GUACAMOLE_SERVER_PORT= \\\r\n    JUMP_SERVER_ADDR= \\\r\n    JUMP_SERVER_PORT= \r\n# 2. 编译安装Python3 和 Python 虚拟环境\r\nADD ./Python-3.6.1 /opt/Python-3.6.1\r\nRUN cd /opt/Python-3.6.1 && \\\r\n\t./configure && make && make install && \\\r\n\tcd /opt && python3 -m venv py3 && source /opt/py3/bin/activate\r\n# 3. 安装jumpserver环境\r\nADD ./jumpserver /opt/jumpserver\r\nRUN source /opt/py3/bin/activate && yum -y install $(cat /opt/jumpserver/requirements/rpm_requirements.txt)\r\n## 3.2. 安装redis（暂不安装，外部指定）\r\n## 3.3. 安装mysql（暂不安装，外部指定）\r\n## 3.4. 修改jumpserver配置文件，打开mysql\r\nADD ./config.py /opt/jumpserver/config.py\r\n# 4. 安装 SSH Server 和 WebSocket Server: Coco\r\nADD ./coco /opt/coco\r\nRUN source /opt/py3/bin/activate && yum -y install $(cat /opt/coco/requirements/rpm_requirements.txt)\r\nADD ./conf.py /opt/coco/conf.py\r\n# 安装pip依赖\r\nRUN source /opt/py3/bin/activate && \\\r\n\tpip install --upgrade pip && \\\r\n\tpip install -r /opt/jumpserver/requirements/requirements.txt && \\\r\n\tpip install -r /opt/coco/requirements/requirements.txt\r\n# 5. 安装luna\r\nADD ./luna /opt/luna\r\n# 6. 安装nginx\r\nRUN yum -y install nginx\r\nCOPY ./nginx.conf /etc/nginx/nginx.conf\r\n# 7. 指定镜像的默认入口\r\nCOPY ./start.sh /usr/bin/\r\nRUN chmod 777 /usr/bin/start.sh\r\nENTRYPOINT [\"/usr/bin/start.sh\"]\r\n```\r\n-----start.sh----\r\n```\r\n#!/bin/bash\r\n# 0. 生成初始化数据\r\n# 1. 配置nginx\r\n# 1.1 coco\r\necho \"----replace nginx starting-----\"\r\nif [ -n \"$COCO_SERVER_ADDR\" ] ; then\r\n  sed -i \"s/COCO_SERVER_ADDR/${COCO_SERVER_ADDR}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/COCO_SERVER_ADDR/localhost/g\" /etc/nginx/nginx.conf\r\nfi\r\nif [ -n \"$COCO_SERVER_PORT\" ] ; then\r\n  sed -i \"s/COCO_SERVER_PORT/${COCO_SERVER_PORT}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/COCO_SERVER_PORT/5000/g\" /etc/nginx/nginx.conf\r\nfi\r\n# 1.2 guacamole\r\nif [ -n \"$GUACAMOLE_SERVER_ADDR\" ] ; then\r\n  sed -i \"s/GUACAMOLE_SERVER_ADDR/${GUACAMOLE_SERVER_ADDR}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/GUACAMOLE_SERVER_ADDR/localhost/g\" /etc/nginx/nginx.conf\r\nfi\r\nif [ -n \"$GUACAMOLE_SERVER_PORT\" ] ; then\r\n  sed -i \"s/GUACAMOLE_SERVER_PORT/${GUACAMOLE_SERVER_PORT}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/GUACAMOLE_SERVER_PORT/8081/g\" /etc/nginx/nginx.conf\r\nfi\r\n# 1.3 jumpserver\r\nif [ -n \"$JUMP_SERVER_ADDR\" ] ; then\r\n  sed -i \"s/JUMP_SERVER_ADDR/${JUMP_SERVER_ADDR}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/JUMP_SERVER_ADDR/localhost/g\" /etc/nginx/nginx.conf\r\nfi\r\nif [ -n \"$JUMP_SERVER_PORT\" ] ; then\r\n  sed -i \"s/JUMP_SERVER_PORT/${JUMP_SERVER_PORT}/g\" /etc/nginx/nginx.conf\r\nelse\r\n  sed -i \"s/JUMP_SERVER_PORT/8080/g\" /etc/nginx/nginx.conf\r\nfi\r\necho \"----replace nginx finished-----\"\r\nif [ \"$1\" = \"init\" ] ; then\r\n # 初始化数据库\r\n  cd /opt/jumpserver/utils\r\n  source /opt/py3/bin/activate\r\n  bash make_migrations.sh\r\n if [ $? -ne 0 ]; then\r\n   echo \"数据初始化成功...\"\r\n else\r\n   echo \"数据初始化失败...\"\r\n fi\r\nelse\r\n  echo \"不需要初始化数据...\"\r\nfi\r\n\r\n# 3. 启动coco\r\necho \"----start coco-----\"\r\ncd /opt/coco\r\nsource /opt/py3/bin/activate\r\n./cocod start -d\r\n# 4. 启动jumpserver\r\necho \"----start jumpserver-----\"\r\ncd /opt/jumpserver\r\nsource /opt/py3/bin/activate\r\n./jms start all -d\r\n# 5. 启动nginx\r\necho \"----start nginx-----\"\r\n/usr/sbin/nginx\r\n# 6. 打开日志\r\necho \"----open log-----\"\r\ntail -f /opt/jumpserver/logs/jumpserver.log\r\n```\r\n"}}
{"actor":{"display_login":"xiaobei-ihmhny"}}