阅读背景:

Cloud9 3.0 SDK安装

来源:互联网 

Cloud9 IDE是一个基于Node.JS构建的JavaScript程序开发Web IDE。它拥有一个非常快的文本编辑器支持为JS, HTML, CSS和这几种的混合代码进行着色显示。Cloud9 IDE还为node.js和Google Chrome集成调试器可以在IDE中启动、暂停和停止。能够在云计算环境中测试和部署你的代码。使用WebDAV,它还可以连到远程工作台。Cloud9 IDE拥有一个插件系统用来扩展现有功能,当前该IDE已经捆绑好几个插件。

一、docker

docker镜像地址:https://hub.docker.com/r/kdelfour/cloud9-docker/

【linux操作记录】
[root@localhost ~]# docker search cloude9
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
[root@localhost ~]# docker search cloud9
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/kdelfour/cloud9-docker Automated Cloud9 IDE (https://c9.io) Build 103 [OK]
docker.io docker.io/sapk/cloud9 Cloud9 instance 40 [OK]
docker.io docker.io/cloud9/workspace Base image for the Cloud9 docker workspaces 11
docker.io docker.io/eeacms/cloud9 Cloud9 v3 Dockerfile 4 [OK]
docker.io docker.io/cloud9/shared Cloud9 shared space 3
docker.io docker.io/mstev0du/cloud9-ide Cloud9 IDE SDK with UID/GID mapping suppor... 3 [OK]
docker.io docker.io/cloud9/ws-cpp C++ workspace type 2
docker.io docker.io/cloud9/ws-default Default workspace 2
docker.io docker.io/rawmind/cloud9-sdk Cloud9 sdk docker image. 2 [OK]
docker.io docker.io/cloud9/ws-php PHP workspace type 1
docker.io docker.io/cloud9/ws-ruby Ruby on Rails workspace type 1
docker.io docker.io/egoexpress/cloud9 Cloud9 IDE (https://c9.io) to use within an... 1 [OK]
docker.io docker.io/lormann/cloud9 Cloud9 v3 1
docker.io docker.io/cloud9/ws-cloud9-hackspace 0
docker.io docker.io/cloud9/ws-coderdojo-nl 0
docker.io docker.io/cloud9/ws-html5 HTML5 workspace type 0
docker.io docker.io/cloud9/ws-meteor 0
docker.io docker.io/cloud9/ws-nodejs node.js workspace type 0
docker.io docker.io/cloud9/ws-python Django workspace type 0
docker.io docker.io/cloud9/ws-python-plain 0
docker.io docker.io/cloud9/ws-wordpress Wordpress workspace type 0
docker.io docker.io/cloverzrg/cloud9 AWS Cloud9 https://aws.amazon.com/cn/cloud9/ 0 [OK]
docker.io docker.io/quimnut/cloud9ide cloud9 ide on phusion image 0
docker.io docker.io/tcjn/cloud9-docker Cloud9 0 [OK]
docker.io docker.io/zuolan/cloud9-ide Cloud9-IDE-v3 on Ubuntu 0
[root@localhost ~]# docker pull docker.io/kdelfour/cloud9-docker
Using default tag: latest
Trying to pull repository docker.io/kdelfour/cloud9-docker ...
latest: Pulling from docker.io/kdelfour/cloud9-docker
a3ed95caeb02: Pull complete
2de59b831a23: Pull complete
a898f8c7f6ba: Pull complete
706514fbad74: Pull complete
e61e3d2ec3f0: Pull complete
9f5d8030ce13: Pull complete
19354fd2342f: Pull complete
2ae48536a0b1: Pull complete
433dc682daa8: Pull complete
a2111130f7f6: Pull complete
6caa5964565f: Pull complete
ed51c3e69066: Pull complete
9d6c8361afb6: Pull complete
ea0ead720ce2: Pull complete
99cd4d82407d: Pull complete
627fe943e133: Pull complete
6761a0276a15: Pull complete
5f2d63e668a7: Pull complete
Digest: sha256:0e47424ea67c175e7705eb44f07f86c4b2a88788eb87b1fc1f65bc3670067716
Status: Downloaded newer image for docker.io/kdelfour/cloud9-docker:latest
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos latest 5182e96772bf 2 months ago 200 MB
docker.io/kdelfour/cloud9-docker latest c75f6cd12329 7 months ago 848 MB
[root@localhost ~]#
[root@localhost ~]# docker run -it -d -p 80:80 kdelfour/cloud9-docker
WARNING: IPv4 forwarding is disabled. Networking will not work.
d0e62b906e410a30ba05c213c8f3fc2c472728885b82cf4df70a80a458adb84f
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d0e62b906e41 kdelfour/cloud9-docker "supervisord -c /e..." 20 seconds ago Up 13 seconds 0.0.0.0:80->80/tcp, 3000/tcp sharp_northcutt

daun:此时可以在浏览器访问看见页面,如下:

 

[root@localhost ~]# docker stop d0e62b906e41
d0e62b906e41
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d0e62b906e41 kdelfour/cloud9-docker "supervisord -c /e..." 4 minutes ago Exited (0) 7 seconds ago sharp_northcutt
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker start d0e62b906e41
d0e62b906e41
[root@localhost ~]# docker exec -it d0e62b906e41 /bin/bash 【duan:进入到容器内部,目录/cloud9就是,改动plugins下的js文件,刷新页面就会出现效果】
root@d0e62b906e41:/cloud9# ls
LICENSE NOTICE bin configs local package.json scripts settings user-plugins
LICENSE-COMMERCIAL-USE README.md build docs node_modules plugins server.js test
root@d0e62b906e41:/cloud9#

 

二、Linux
源码下载地址:https://github.com/c9/core

Linux需要先行安装nodejs,python 等

--------------------------------------------
CentOS 下源码安装 Node.js
1、下载源码,你需要在https://nodejs.org/en/download/下载最新的Nodejs版本,本文以v0.10.24为例:

cd /usr/local/src/
wget https://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2、解压源码

tar zxvf node-v0.10.24.tar.gz
3、 编译安装

cd node-v0.10.24
./configure --prefix=/usr/local/node/0.10.24
make
make install
4、 配置NODE_HOME,进入profile编辑环境变量
vim /etc/profile
设置nodejs环境变量,在 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 一行的上面添加如下内容:

#set for nodejs
export NODE_HOME=/usr/local/node/0.10.24
export PATH=$NODE_HOME/bin:$PATH
:wq保存并退出,编译/etc/profile 使配置生效

source /etc/profile
验证是否安装配置成功

node -v
输出 v0.10.24 表示配置成功
--------------------------------------------

nodejs安装完成后安装c9
步骤如下:
git clone https://github.com/c9/core.git c9sdk
cd c9sdk
scripts/install-sdk.sh

运行:node server.js
访问:https://localhost:8181/ide.html

运行:node server.js -p 8080 -a :
访问:https://127.0.0.1:8080/ide.html
-------------------------


【linux操作记录】

[root@localhost home]# 

[root@localhost home]# git clone git://github.com/c9/core.git c9sdk
正克隆到 'c9sdk'...
remote: Enumerating objects: 52806, done.
remote: Total 52806 (delta 0), reused 0 (delta 0), pack-reused 52806
接收对象中: 100% (52806/52806), 35.29 MiB | 41.00 KiB/s, done.
处理 delta 中: 100% (32452/32452), done.

[root@localhost home]# cd c9sdk
[root@localhost c9sdk]# ls
bin docs NOTICE server.js
build LICENSE package.json settings
CODE_OF_CONDUCT.md LICENSE-COMMERCIAL-USE plugins test
configs local README.md user-plugins
CONTRIBUTING.md node_modules scripts
[root@localhost c9sdk]#


[root@localhost c9sdk]#
[root@localhost c9sdk]#
[root@localhost c9sdk]# scripts/install-sdk.sh 【duan:这一步会有报错出现,根据提示,进行操作】
which: no npm in (/usr/lib64/qt-3.3/bin:/root/perl5/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin)
来自 https://github.com/c9/core
* [新分支] c9 -> c9/c9
* [新分支] gh-pages -> c9/gh-pages
* [新分支] master -> c9/master
* [新分支] smf-sdk -> c9/smf-sdk
Already up-to-date.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12157 100 12157 0 0 8363 0 0:00:01 0:00:01 --:--:-- 8366
Error: please install glibc-static to proceed
To do so, log into your machine and type 'yum install glibc-static'
[root@localhost c9sdk]# yum install glibc-static
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
........................

[email protected] node_modules/connect
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected])
--------------------------------------------------------------------
Success!
run 'node server.js -p 8080 -a :' to launch Cloud9

------------------------------------------------------------------------------------------
出现上面的Success!提示,就是安装成功了


启动:
[root@localhost c9sdk]# node server.js -p 8080 -a :
Starting standalone
Connect server listening at https://127.0.0.1:8080
CDN: version standalone initialized /home/c9sdk/build
Started '/home/c9sdk/configs/standalone' with config 'standalone'!
Cloud9 is up and running

截图:

 


分享到: