├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml └── supervisord.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Based on a work at https://github.com/docker/docker. 3 | # ------------------------------------------------------------------------------ 4 | # Pull base image. 5 | FROM tutum/ubuntu:trusty 6 | MAINTAINER Agung Firdaus 7 | 8 | # ------------------------------------------------------------------------------ 9 | # Install dependencies 10 | RUN apt-get update && apt-get -y install git curl build-essential supervisor 11 | 12 | # ------------------------------------------------------------------------------ 13 | # Install nodejs 14 | RUN curl -sL https://deb.nodesource.com/setup | sudo bash - 15 | RUN apt-get -y install nodejs 16 | 17 | # ------------------------------------------------------------------------------ 18 | # Get cloud9 source and install 19 | RUN git clone https://github.com/c9/core.git /tmp/c9 20 | RUN cd /tmp/c9 && scripts/install-sdk.sh 21 | RUN mv /tmp/c9 /cloud9 22 | WORKDIR /cloud9 23 | 24 | # ------------------------------------------------------------------------------ 25 | # Add workspace volumes 26 | RUN mkdir /cloud9/workspace 27 | VOLUME /cloud9/workspace 28 | 29 | # ------------------------------------------------------------------------------ 30 | # Set default workspace dir 31 | ENV C9_WORKSPACE /cloud9/workspace 32 | 33 | # ------------------------------------------------------------------------------ 34 | # Add supervisord conf 35 | ADD supervisord.conf /etc/supervisor/conf.d/ 36 | 37 | # ------------------------------------------------------------------------------ 38 | # Clean up APT when done. 39 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 40 | 41 | # ------------------------------------------------------------------------------ 42 | # Expose ports. 43 | EXPOSE 8181 44 | 45 | # ------------------------------------------------------------------------------ 46 | # Start supervisor, define default command. 47 | ENTRYPOINT /usr/bin/supervisord 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Kevin Delfour 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cloud9 IDE Dockerfile 2 | ================ 3 | 4 | This repository contains Dockerfile of Cloud9 IDE with some usefull features for convenience and secure development environment for Docker's automated build published to the public Docker Hub Registry. 5 | 6 | ## features: 7 | - Auto protect the IDE with user defined (or default) password. 8 | - SSH access to the container using user defined(or generated) password and or user defined SSH key. 9 | - Custom container workspace directory (make it easier to link with VOLUME_FROM other container, not just host directory mapping). 10 | - Optimized build process (please suggest if any idea to make it better) 11 | 12 | # Base Docker Image 13 | [tutum/ubuntu:trusty](https://registry.hub.docker.com/u/tutum/ubuntu/) 14 | 15 | # Installation 16 | 17 | ## Install Docker. 18 | 19 | Download automated build from public Docker Hub Registry: 20 | 21 | docker pull agungf/cloud9-ide 22 | 23 | alternatively, you can build an image from Dockerfile: 24 | 25 | docker build -t="$USER/cloud9-ide" github.com/agungf/cloud9-ide 26 | 27 | 28 | ## Basic Usage 29 | 30 | docker run -it -d -p 8181:8181 -p 2222:22 agungf/cloud9-ide 31 | 32 | It will take care all the defaults to: 33 | 34 | - Cloud9 Basic http auth User `root` , with DEFAULT password: `secret` 35 | - See Auto generated SSH password for root at log, `docker logs ` 36 | - Workspace directory at `/cloud9/workspace` 37 | 38 | You can add a workspace as a volume directory with the argument *-v /your-path/workspace/:cloud9/workspace* like this : 39 | 40 | docker run -it -d -p 8181:8181 -v /your-path/workspace/:/cloud9/workspace agungf/cloud9-ide 41 | 42 | 43 | ## Advance Usage 44 | 45 | Get the latest version from github 46 | 47 | git clone https://github.com/agungf/cloud9-ide 48 | cd cloud9-ide/ 49 | 50 | Run with docker compose: 51 | 52 | docker-compose up -d 53 | 54 | Example docker-compose.yml: 55 | 56 | ide: 57 | build: . 58 | environment: 59 | - ROOT_PASS=thesecrets 60 | - C9_WORKSPACE=/data/workspace 61 | volumes_from: 62 | - data 63 | ports: 64 | - 8181:8181 65 | - 22 66 | data 67 | image:tutum/ubuntu 68 | volumes: 69 | - /data/workspace 70 | 71 | 72 | It will set the parameters to: 73 | 74 | - Cloud9 Basic hhtp Auth User `root` , with password: `thesecrets` 75 | - SSH root password : `thesecrets` 76 | - Workspace directory at `/data/workspace` linked to VOLUME_FROM `data` container 77 | 78 | 79 | ## Set SSH Key 80 | 81 | [See tutum/ubuntu README](https://github.com/tutumcloud/tutum-ubuntu/blob/master/README.md) 82 | 83 | 84 | Happy Coding !! 85 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | ide: 2 | build: . 3 | environment: 4 | - C9_WORKSPACE=/cloud9/workspace 5 | - ROOT_PASS=thesecrets 6 | volumes: 7 | - /data/workspace:/cloud9/workspace 8 | ports: 9 | - 8181:8181 10 | - 22 11 | -------------------------------------------------------------------------------- /supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:cloud9] 5 | command = /bin/bash -c '_PASSWORD=${ROOT_PASS:-${C9_PASS}} && echo ">>> Use -- root -- as username and -- $_PASSWORD -- as password to connect with C9"&& node server.js -l 0.0.0.0 -w $C9_WORKSPACE --auth root:$_PASSWORD' 6 | directory = /cloud9 7 | user = root 8 | autostart = true 9 | autorestart = true 10 | stdout_logfile=/dev/stdout 11 | stdout_logfile_maxbytes=0 12 | stderr_logfile = /var/log/supervisor/cloud9_errors.log 13 | environment = NODE_ENV='production', C9_PASS='secret' 14 | 15 | [program:sshd] 16 | command=/run.sh 17 | stdout_logfile=/dev/stdout 18 | stdout_logfile_maxbytes=0 19 | --------------------------------------------------------------------------------