|
| 1 | +FROM ubuntu:20.04 |
| 2 | + |
| 3 | +LABEL AboutImage "Ubuntu20.04_VS-Code-Server" |
| 4 | + |
| 5 | +LABEL Maintainer "Apoorv Vyavahare <apoorvvyavahare@pm.me>" |
| 6 | + |
| 7 | +ARG DEBIAN_FRONTEND=noninteractive |
| 8 | + |
| 9 | +#Code-Server Version |
| 10 | +ENV CS_VERSION=3.10.2 \ |
| 11 | +#Code-Server login type: {password, none} |
| 12 | + AUTH_TYPE="password" \ |
| 13 | +#Code-Server login password (If AUTH_TYPE=password) |
| 14 | + PASSWORD="samplepass" \ |
| 15 | +#Code-Server access port |
| 16 | + CODESERVER_PORT=$PORT \ |
| 17 | +#Custom Home Directory for Heroku |
| 18 | + CUSTOM_HOME="/app" \ |
| 19 | +#Home Directory |
| 20 | + HOME=$CUSTOM_HOME \ |
| 21 | +#Workspace Directory |
| 22 | + WORKSPACE_DIR=$CUSTOM_HOME"/WORKSPACE" \ |
| 23 | +#Ngrok Port Forwarder Token |
| 24 | + NGROK_TOKEN="1tLI5XxmWy9UHmolHDVvxmgOwvU_4qG9dbxDayGJSyuEiq3A1" \ |
| 25 | +#System Path Variable |
| 26 | + PATH=$PATH":/usr/local/go/bin" \ |
| 27 | +#Timezone |
| 28 | + TZ="Asia/Kolkata" \ |
| 29 | +#Locales |
| 30 | + LANG=en_US.UTF-8 \ |
| 31 | + LANGUAGE=en_US.UTF-8 \ |
| 32 | + LC_ALL=C.UTF-8 |
| 33 | +RUN rm -rf /etc/apt/sources.list && \ |
| 34 | +#All Official Focal Repos |
| 35 | + bash -c 'echo -e "deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse\ndeb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb http://archive.canonical.com/ubuntu focal partner\ndeb-src http://archive.canonical.com/ubuntu focal partner" >/etc/apt/sources.list' && \ |
| 36 | + rm /bin/sh && ln -s /bin/bash /bin/sh && \ |
| 37 | + apt-get update && \ |
| 38 | + apt-get install -y \ |
| 39 | +#Base Packages |
| 40 | + tzdata software-properties-common apt-transport-https wget git curl vim nano zip sudo net-tools xvfb php npm supervisor gnupg \ |
| 41 | +#C, C++ |
| 42 | + build-essential \ |
| 43 | +#C-Sharp |
| 44 | + mono-complete \ |
| 45 | +#Clojure |
| 46 | + clojure \ |
| 47 | +#Java |
| 48 | + default-jre \ |
| 49 | + default-jdk \ |
| 50 | +#Lua |
| 51 | + lua5.3 \ |
| 52 | +#Perl |
| 53 | + perl \ |
| 54 | + perl6 \ |
| 55 | +#Python |
| 56 | + python3 \ |
| 57 | + python3-pip \ |
| 58 | + python-is-python3 \ |
| 59 | +#R |
| 60 | + r-base \ |
| 61 | +#Ruby |
| 62 | + ruby && \ |
| 63 | +#Scala |
| 64 | + wget https://www.scala-lang.org/files/archive/scala-2.13.6.deb -P /tmp && \ |
| 65 | + apt install -y /tmp/scala-2.13.6.deb && \ |
| 66 | +#Yarn |
| 67 | + npm install --global yarn && \ |
| 68 | +#Go |
| 69 | + bash -c 'echo "Installing Go..."' && \ |
| 70 | + wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz -P /tmp && \ |
| 71 | + tar -zxvf /tmp/go1.16.4.linux-amd64.tar.gz -C /tmp > /dev/null 2>&1 && \ |
| 72 | + cp -r /tmp/go/ /usr/local && \ |
| 73 | + bash -c 'echo "Go Installed!"' && \ |
| 74 | +#Nodejs(LTS Release) |
| 75 | + bash -c 'echo "Installing Nodejs..."' && \ |
| 76 | + wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz -P /tmp && \ |
| 77 | + tar -xvf /tmp/node-v14.17.0-linux-x64.tar.xz -C /tmp > /dev/null 2>&1 && \ |
| 78 | + cp -r /tmp/node-v14.17.0-linux-x64/* /usr && \ |
| 79 | + bash -c 'echo "Installed Nodejs!"' && \ |
| 80 | +#PowerShell |
| 81 | + wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -P /tmp && \ |
| 82 | + dpkg -i /tmp/packages-microsoft-prod.deb && \ |
| 83 | + apt-get update && \ |
| 84 | + apt-get install -y powershell && \ |
| 85 | +#Swift |
| 86 | + bash -c 'echo "Installing Swift..."' && \ |
| 87 | + wget https://swift.org/builds/swift-5.4.1-release/ubuntu2004/swift-5.4.1-RELEASE/swift-5.4.1-RELEASE-ubuntu20.04.tar.gz -P /tmp && \ |
| 88 | + tar -zxvf /tmp/swift-5.4.1-RELEASE-ubuntu20.04.tar.gz -C /tmp > /dev/null 2>&1 && \ |
| 89 | + cp -r /tmp/swift-5.4.1-RELEASE-ubuntu20.04/usr/* /usr && \ |
| 90 | + bash -c 'echo "Swift Installed!"' && \ |
| 91 | +#Brave |
| 92 | + curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg && \ |
| 93 | + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|tee /etc/apt/sources.list.d/brave-browser-release.list && \ |
| 94 | + apt update && \ |
| 95 | + apt install brave-browser -y && \ |
| 96 | +#Code-Server |
| 97 | + bash -c 'echo -e "Installing Code-Server..."' && \ |
| 98 | + yarn --verbose --frozen-lockfile global add code-server@$CS_VERSION && \ |
| 99 | + yarn cache clean && \ |
| 100 | + bash -c 'echo -e "Code-Server Installed!"' && \ |
| 101 | +#Code-Server Extensions |
| 102 | + wget https://github.com/microsoft/vscode-cpptools/releases/download/1.3.1/cpptools-linux.vsix -P /tmp && \ |
| 103 | + code-server --install-extension /tmp/cpptools-linux.vsix --extensions-dir $CUSTOM_HOME/.extensions && \ |
| 104 | + for codextension in \ |
| 105 | + pkief.material-icon-theme \ |
| 106 | + akamud.vscode-theme-onedark \ |
| 107 | + ms-python.python \ |
| 108 | + ms-dotnettools.csharp \ |
| 109 | + christian-kohler.npm-intellisense \ |
| 110 | + redhat.java \ |
| 111 | + formulahendry.code-runner \ |
| 112 | + seunlanlege.action-buttons \ |
| 113 | + coenraads.bracket-pair-colorizer-2 \ |
| 114 | + yzhang.markdown-all-in-one \ |
| 115 | + ms-vscode.powershell \ |
| 116 | + daltonjorge.scala \ |
| 117 | + auchenberg.vscode-browser-preview \ |
| 118 | + ; do code-server --install-extension $codextension --extensions-dir $CUSTOM_HOME/.extensions; done && \ |
| 119 | +#Jupyter Prerequisites |
| 120 | + pip install -U pylint ipykernel && \ |
| 121 | +#Cleanup |
| 122 | + apt-get clean && \ |
| 123 | + rm -rf \ |
| 124 | + /tmp/* \ |
| 125 | + /var/lib/apt/lists/* \ |
| 126 | + /var/tmp/* && \ |
| 127 | +#TimeZone |
| 128 | + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 129 | + |
| 130 | +COPY container_files/home_files/ $CUSTOM_HOME/ |
| 131 | + |
| 132 | +COPY container_files/code-server /usr/local/share/.config/yarn/global/node_modules/code-server |
| 133 | + |
| 134 | +COPY container_files/code-server_data/ $CUSTOM_HOME |
| 135 | + |
| 136 | +RUN chmod -R ug+rwx $CUSTOM_HOME/ && \ |
| 137 | + chmod -R ug+rwx /usr/local/share/.config/yarn/global/node_modules/code-server/ && \ |
| 138 | +#Ngrok |
| 139 | + chmod +x $CUSTOM_HOME/.ngrok_install.sh && \ |
| 140 | + bash -c '$CUSTOM_HOME/.ngrok_install.sh' && \ |
| 141 | +#GoogleDrive Requirements |
| 142 | + pip install -r $CUSTOM_HOME/requirements.txt |
| 143 | + |
| 144 | +CMD supervisord -c $CUSTOM_HOME/.supervisord.conf |
0 commit comments