Last active
December 19, 2017 05:47
-
-
Save jeremyje/bc76c76b5e7cd6953f985156d331eaa5 to your computer and use it in GitHub Desktop.
Installs Docker and Cloud 9 on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # curl https://gist.githubusercontent.com/jeremyje/bc76c76b5e7cd6953f985156d331eaa5/raw/install-cloud9.sh | bash -s $HOME/workspace | |
| CONTAINER_NAME=cloud9 | |
| CONTAINER_IMAGE=jeremyje/dev | |
| WORKSPACE=$1 | |
| shift | |
| mkdir -p ${WORKSPACE} | |
| docker pull ${CONTAINER_IMAGE} | |
| docker rm -f ${CONTAINER_NAME} | |
| docker create --name ${CONTAINER_NAME} --interactive --tty -p 8000:8181 -p 8080:8080 -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 -p 8085:8085 --volume ${WORKSPACE}:/home/c9user/workspace/ ${CONTAINER_IMAGE} $@ | |
| docker start ${CONTAINER_NAME} | |
| hostname=$(hostname) | |
| echo "" | |
| echo "" | |
| echo "Cloud 9 IDE is running at, http://${HOSTNAME}:8000/" | |
| echo "To host a server use ports 8080-8085. Within the IDE you can use \$C9_PORT to host a server with the default port, 8080." | |
| echo "Make sure you run ~/setup.sh in Cloud 9 IDE to initialize Git and SSH keys." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # sudo apt update; sudo apt install -y curl; curl https://gist.githubusercontent.com/jeremyje/bc76c76b5e7cd6953f985156d331eaa5/raw/install-docker.sh | bash | |
| # https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#supported-storage-drivers | |
| sudo apt remove docker docker-engine docker.io -y | |
| sudo apt-get update | |
| sudo apt-get -y -qq install \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo apt-key fingerprint 0EBFCD88 | |
| # For some reason artful target doesn't work yet. | |
| release_codename=$(lsb_release -cs) | |
| if [ $release_codename = 'artful' ]; | |
| then | |
| release_codename="zesty" | |
| fi | |
| sudo add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
| ${release_codename} \ | |
| stable" | |
| sudo apt-get update | |
| sudo apt-get install -y docker-ce | |
| sudo usermod -aG docker $USER | |
| echo "" | |
| echo "" | |
| echo "Docker installed, YOU MUST LOG OUT!" | |
| echo "" | |
| echo "" | |
| echo "If you're installing Cloud 9 IDE run this command in a new terminal window." | |
| echo " curl https://gist.githubusercontent.com/jeremyje/bc76c76b5e7cd6953f985156d331eaa5/raw/install-cloud9.sh | bash -s $HOME/workspace" | |
| echo "(Replace $HOME/workspace with the directory you want your workspace to be." |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the following commands to install.