Skip to content

Cloud9

Cloud9 combines a powerful online code editor with a full Ubuntu workspace in the cloud.

Local Download

Cloud9 Core - master e9490da (2018-08-23)
https://github.com/c9/core
Core-master-e9490da.zip

Docker example

Dockerfile sample:

FROM node:5.12-slim
#MAINTAINER Ryan J. McDonough "[email protected]"
MAINTAINER Raul Sanchez <[email protected]>

ENV SERVICE_HOME=/opt/cloud9 \
    SERVICE_URL=https://github.com/c9/core.git \
    SERVICE_WORK=/workspace

RUN mkdir -p $SERVICE_HOME $SERVICE_WORK && \
    apt-get update && \
    apt-get install -y python build-essential g++ libssl-dev apache2-utils git libxml2-dev && \
    git clone $SERVICE_URL $SERVICE_HOME && \
    cd $SERVICE_HOME && \
    scripts/install-sdk.sh && \
    sed -i -e 's_127.0.0.1_0.0.0.0_g' $SERVICE_HOME/configs/standalone.js && \
    apt-get autoremove -y python build-essential libssl-dev g++ libxml2-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 

ADD root /
RUN chmod +x /tmp/*.sh 

WORKDIR $SERVICE_WORK

EXPOSE 8080

ENTRYPOINT ["/tmp/start.sh"]
CMD ["--listen 0.0.0.0 -p 8080 -w $SERVICE_WORK"]

root/tmp/start.sh file:

#!/usr/bin/env sh

if [ "x$GIT_REPO" != "x" ]; then
    cd $SERVICE_WORK
    git clone $GIT_REPO
fi

cd $SERVICE_HOME && /usr/local/bin/node server.js $@

Compose file:

cloud9-sdk:
  command: "--listen 0.0.0.0 --port ${cloud9_port} -w /workspace --collab --auth ${cloud9_user}:${cloud9_pass}"
  image: "rawmind/cloud9-sdk:0.3.0-2"
  restart: "always"
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
    - "/usr/local/bin/docker:/bin/docker"
    - "/workspace"
  environment:
    GIT_REPO: ${cloud9_repo}
  labels:
    traefik.domain: ${cloud9_domain}
    traefik.port: ${cloud9_port}
traefik.enable: ${cloud9_publish}

Cloud9 SDK Docker Container

A slightly more complicated setup so you can run docker as well:

$ docker run -d -v $(pwd):/workspace \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v $(which docker):/bin/docker -p 8080:8080 \
    damnhandy/cloud9-sdk --listen 0.0.0.0 -p 8080 -w /workspace -a ${USER}:${PASS}

This will allow you to run docker commands on the host socket from within the Cloud9 SDK container.

See also

  • IDE
  • Gitpod - 오픈소스 원격 개발 플랫폼이다.

Favorite site

References


  1. How_to_install_Cloud9_SDK_in_Ubuntu.pdf