美文网首页
centos7 安装eclipse-che

centos7 安装eclipse-che

作者: yexue | 来源:发表于2018-09-06 16:10 被阅读365次

    docker安装
    官网地址:https://www.eclipse.org/che/docs/quick-start.html
    官方给出命令

    docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v /local/path:/data eclipse/che start
    
    /local/path->自己指定data目录
    

    直接运行上面命名会 permission denied 没有权限,改成

    docker run -ti --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /local/path:/data eclipse/che start
    

    参考docker挂载目录失败/权限拒绝 解决方案

    然后,不出意外

    [root@localhost bin]#  docker run -ti --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /opt/eclipse-che:/data eclipse/che start
    WARN: Bound 'eclipse/che' to 'eclipse/che:6.10.0'
    INFO: (che cli): 6.10.0 - using docker 1.13.1 / native
    INFO: (che download): Checking for image 'eclipse/che-action:6.10.0'... not found
    INFO: (che download): Pulling image eclipse/che-action:6.10.0
    
    Trying to pull repository docker.io/eclipse/che-action ...
    6.10.0: Pulling from docker.io/eclipse/che-action
    4064ffdc82fe: Already exists
    f7773b768266: Pull complete
    e25be85b0612: Pull complete
    e2d0738c39aa: Pull complete
    6a67fc1389fe: Pull complete
    adf209fc0c2c: Pull complete
    Digest: sha256:57b5a3860d135ed5ecbec2223f4c3324c80a08f3344b48d11265468493642d67
    Status: Downloaded newer image for docker.io/eclipse/che-action:6.10.0
    
    INFO: (che download): Checking for image 'eclipse/che-dir:6.10.0'... not found
    INFO: (che download): Pulling image eclipse/che-dir:6.10.0
    
    Trying to pull repository docker.io/eclipse/che-dir ...
    6.10.0: Pulling from docker.io/eclipse/che-dir
    4064ffdc82fe: Already exists
    f7773b768266: Already exists
    e25be85b0612: Already exists
    e2d0738c39aa: Already exists
    6a67fc1389fe: Already exists
    adf209fc0c2c: Already exists
    Digest: sha256:b0f0cbe9b946fda70274e793859c61ff95268086dfdbf009847726a3f24980af
    Status: Downloaded newer image for docker.io/eclipse/che-dir:6.10.0
    
    INFO: (che download): Checking for image 'eclipse/che-test:6.10.0'... not found
    INFO: (che download): Pulling image eclipse/che-test:6.10.0
    
    Trying to pull repository docker.io/eclipse/che-test ...
    6.10.0: Pulling from docker.io/eclipse/che-test
    4064ffdc82fe: Already exists
    f7773b768266: Already exists
    e25be85b0612: Already exists
    e2d0738c39aa: Already exists
    6a67fc1389fe: Already exists
    adf209fc0c2c: Already exists
    Digest: sha256:b63fac5a4c30230608310da122986065e31802206f6eafdbb9ba522367b68966
    Status: Downloaded newer image for docker.io/eclipse/che-test:6.10.0
    
    INFO: (che download): Checking for image 'eclipse/che-mount:6.10.0'... not found
    INFO: (che download): Pulling image eclipse/che-mount:6.10.0
    
    Trying to pull repository docker.io/eclipse/che-mount ...
    6.10.0: Pulling from docker.io/eclipse/che-mount
    81033e7c1d6a: Already exists
    d407cf894430: Pull complete
    90fffb00f7fa: Pull complete
    dbf0760e1ebc: Pull complete
    Digest: sha256:6c726c9a80d9c3538683506b50d0c6d97366f682b373f348e8e1b7c4ae3b2a6c
    Status: Downloaded newer image for docker.io/eclipse/che-mount:6.10.0
    
    INFO: (che init): Installing configuration and bootstrap variables:
    INFO: (che init):   CHE_HOST=192.168.56.102
    INFO: (che init):   CHE_VERSION=6.10.0
    INFO: (che init):   CHE_CONFIG=/opt/eclipse-che
    INFO: (che init):   CHE_INSTANCE=/opt/eclipse-che/instance
    INFO: (che config): Generating che configuration...
    INFO: (che config): Customizing docker-compose for running in a container
    INFO: (che start): Preflight checks
             mem (1.5 GiB):           [OK]
             disk (100 MB):           [OK]
             port 8080 (http):        [AVAILABLE]
             conn (browser => ws):    [NOT OK]
             conn (server => ws):     [NOT OK]
    
    
    ERROR: Try 'docker run <options> eclipse/che info --network' for more tests.
    
    

    绝不绝望.....

    在狗狗上找了半天看不懂的English
    大概就是防火墙和服务ip的问题

    解决服务ip

    修改环境比变量 CHE_HOST=本机ip

    docker run -ti --rm  --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /opt/eclipse-che:/data -e CHE_HOST=192.168.56.102 eclipse/che start
    

    好吧,还有防火墙

    继续找了半天
    终于发现了一个有用的
    Eclipse Che – Custom Service for firewall-cmd
    原谅我的爱国情怀高于一切(英文看不懂.....)
    翻译了一下,大概就是 找了一个现成的ssh.xml防火墙配置,copy一份改一下

    <?xml version="1.0" encoding="utf-8"?>
    <service>
      <short>docker-eclipse-she</short>
      <description>Eclipse Che is a next-generation cloud IDE and workspace server that can run anywhere Docker runs. For more information, see https://www.eclipse.org/che/docs/setup/getting-started/</description>
      <port protocol="tcp" port="32768-65535"/>
    </service>
    

    然后

    firewall-cmd --reload
    firewall-cmd --get-services
    firewall-cmd --zone=public --add-service=docker-eclipse-che
    

    完了继续

    docker run -ti --rm  --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /opt/eclipse-che:/data -e CHE_HOST=192.168.56.102 eclipse/che start
    

    结果

    [root@localhost bin]# docker run -ti --rm  --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /opt/eclipse-che:/data -e CHE_HOST=192.168.56.102 eclipse/che start
    WARN: Bound 'eclipse/che' to 'eclipse/che:6.10.0'
    INFO: (che cli): 6.10.0 - using docker 1.13.1 / native
    INFO: (che config): Generating che configuration...
    INFO: (che config): Customizing docker-compose for running in a container
    INFO: (che start): Preflight checks
             mem (1.5 GiB):           [OK]
             disk (100 MB):           [OK]
             port 8080 (http):        [AVAILABLE]
             conn (browser => ws):    [OK]
             conn (server => ws):     [OK]
    
    INFO: (che start): Starting containers...
    INFO: (che start): Services booting...
    INFO: (che start): Server logs at "docker logs -f che"
    ERROR: (che start): Timeout waiting for server. Run "docker logs che" to inspect.
    

    纳尼。。。。。

    ERROR

    日志服务器没起来.....(后续再解决吧!)
    不过不影响使用了


    http://192.168.56.102:8080

    温馨提示:天朝访问DockerHub可能不是那么顺心顺义,造成镜像下载失败。解决方式呢要么不停的重试,要么代理。
    可以参考Linux终端使用SSR服务

    多环境

    docker run -ti --rm  --privileged=true -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/pro/eclipse-che:/data -e CHE_HOST=192.168.31.100 -e CHE_MULTIUSER=true eclipse/che start
    

    相关文章

      网友评论

          本文标题:centos7 安装eclipse-che

          本文链接:https://www.haomeiwen.com/subject/zmuxgftx.html