Create Dockerfile
Browse files- Dockerfile +130 -0
Dockerfile
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:latest
|
| 2 |
+
|
| 3 |
+
# 更新软件包列表并安装基本工具
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
build-essential \
|
| 6 |
+
curl \
|
| 7 |
+
git \
|
| 8 |
+
wget \
|
| 9 |
+
unzip \
|
| 10 |
+
software-properties-common
|
| 11 |
+
|
| 12 |
+
# 安装 zsh、ripgrep
|
| 13 |
+
RUN apt-get install -y zsh ripgrep golang screen vim cmake openjdk-17-jdk openjdk-17-jre gdb
|
| 14 |
+
|
| 15 |
+
# 安装 Python 和 pip,以及 conda
|
| 16 |
+
RUN apt-get install -y python3 python3-pip
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
# 安装 C 和 C++ 编译器
|
| 20 |
+
RUN apt-get install -y gcc g++
|
| 21 |
+
|
| 22 |
+
# 安装 Ruby
|
| 23 |
+
RUN apt-get install -y ruby-full nodejs
|
| 24 |
+
|
| 25 |
+
# 安装 Rust
|
| 26 |
+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
| 27 |
+
|
| 28 |
+
# 安装 Dart 和 Flutter
|
| 29 |
+
RUN apt-get install -y apt-transport-https && \
|
| 30 |
+
wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
| 31 |
+
echo "deb https://storage.googleapis.com/download.dartlang.org/linux/debian stable main" | tee /etc/apt/sources.list.d/dart_stable.list && \
|
| 32 |
+
apt-get update && \
|
| 33 |
+
apt-get install -y dart
|
| 34 |
+
|
| 35 |
+
# 下载并安装 Visual Studio Code 服务版
|
| 36 |
+
RUN wget -O vscode.tar.gz "https://update.code.visualstudio.com/latest/server-linux-x64-web/stable" && \
|
| 37 |
+
mkdir -p /usr/local/vscode && \
|
| 38 |
+
tar -xzf vscode.tar.gz -C /usr/local/vscode --strip-components=1 && \
|
| 39 |
+
rm vscode.tar.gz
|
| 40 |
+
|
| 41 |
+
# Switch to the "user" user
|
| 42 |
+
USER ubuntu
|
| 43 |
+
|
| 44 |
+
# 安装 zsh、ripgrep 和 oh-my-zsh
|
| 45 |
+
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
|
| 46 |
+
sed -i 's/robbyrussell/bira/g' /home/ubuntu/.zshrc && \
|
| 47 |
+
echo 'plugins=(git golang node npm pip python debian extract)' >> /home/ubuntu/.zshrc
|
| 48 |
+
|
| 49 |
+
# 安装 flutter
|
| 50 |
+
RUN git clone https://github.com/flutter/flutter.git -b stable --depth 1 /home/ubuntu/.local/flutter && \
|
| 51 |
+
/home/ubuntu/.local/flutter/bin/flutter config --no-analytics && \
|
| 52 |
+
/home/ubuntu/.local/flutter/bin/flutter precache && \
|
| 53 |
+
echo 'export PATH=$PATH:/home/ubuntu/.local/flutter/bin:/home/ubuntu/.local/conda/bin' >> /home/ubuntu/.bashrc && \
|
| 54 |
+
echo 'export PATH=$PATH:/home/ubuntu/.local/flutter/bin:/home/ubuntu/.local/conda/bin' >> /home/ubuntu/.zshrc
|
| 55 |
+
|
| 56 |
+
# Set home to the user's home directory
|
| 57 |
+
ENV HOME=/home/ubuntu \
|
| 58 |
+
PATH=/home/ubuntu/.local/bin:$PATH
|
| 59 |
+
|
| 60 |
+
# Set the working directory to the user's home directory
|
| 61 |
+
WORKDIR $HOME/app
|
| 62 |
+
|
| 63 |
+
# 安装 Node.js 和 npm,以及 nvm 和 pnpm
|
| 64 |
+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash && \
|
| 65 |
+
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> /home/ubuntu/.bashrc && \
|
| 66 |
+
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.zshrc && \
|
| 67 |
+
. ~/.nvm/nvm.sh
|
| 68 |
+
|
| 69 |
+
# 安装 Visual Studio Code 插件
|
| 70 |
+
RUN mkdir -p /home/ubuntu/.vscode && \
|
| 71 |
+
/usr/local/vscode/bin/code-server --extensions-dir /home/ubuntu/.vscode \
|
| 72 |
+
--install-extension aaron-bond.better-comments \
|
| 73 |
+
--install-extension adpyke.codesnap \
|
| 74 |
+
--install-extension ccagml.vscode-leetcode-problem-rating \
|
| 75 |
+
--install-extension dart-code.dart-code \
|
| 76 |
+
--install-extension dart-code.flutter \
|
| 77 |
+
--install-extension dbaeumer.vscode-eslint \
|
| 78 |
+
--install-extension dsznajder.es7-react-js-snippets \
|
| 79 |
+
--install-extension eamodio.gitlens \
|
| 80 |
+
--install-extension editorconfig.editorconfig \
|
| 81 |
+
--install-extension esbenp.prettier-vscode \
|
| 82 |
+
--install-extension formulahendry.code-runner \
|
| 83 |
+
--install-extension giscafer.leek-fund \
|
| 84 |
+
--install-extension golang.go \
|
| 85 |
+
--install-extension humao.rest-client \
|
| 86 |
+
--install-extension johnpapa.vscode-peacock \
|
| 87 |
+
--install-extension leetcode.vscode-leetcode \
|
| 88 |
+
--install-extension ms-azuretools.vscode-docker \
|
| 89 |
+
--install-extension ms-python.debugpy \
|
| 90 |
+
--install-extension ms-python.isort \
|
| 91 |
+
--install-extension ms-python.python \
|
| 92 |
+
--install-extension ms-python.vscode-pylance \
|
| 93 |
+
--install-extension ms-toolsai.jupyter \
|
| 94 |
+
--install-extension ms-toolsai.jupyter-keymap \
|
| 95 |
+
--install-extension ms-toolsai.jupyter-renderers \
|
| 96 |
+
--install-extension ms-toolsai.vscode-jupyter-cell-tags \
|
| 97 |
+
--install-extension ms-toolsai.vscode-jupyter-slideshow \
|
| 98 |
+
--install-extension ms-vscode-remote.remote-containers \
|
| 99 |
+
--install-extension ms-vscode-remote.remote-ssh \
|
| 100 |
+
--install-extension ms-vscode-remote.remote-ssh-edit \
|
| 101 |
+
--install-extension ms-vscode.cpptools \
|
| 102 |
+
--install-extension ms-vscode.cpptools-extension-pack \
|
| 103 |
+
--install-extension ms-vscode.cpptools-themes \
|
| 104 |
+
--install-extension ms-vscode.js-debug-companion \
|
| 105 |
+
--install-extension ms-vscode.remote-explorer \
|
| 106 |
+
--install-extension msjsdiag.vscode-react-native \
|
| 107 |
+
--install-extension rangav.vscode-thunder-client \
|
| 108 |
+
--install-extension redhat.java \
|
| 109 |
+
--install-extension rust-lang.rust-analyzer \
|
| 110 |
+
--install-extension shd101wyy.markdown-preview-enhanced \
|
| 111 |
+
--install-extension streetsidesoftware.code-spell-checker \
|
| 112 |
+
--install-extension twxs.cmake \
|
| 113 |
+
--install-extension visualstudioexptteam.vscodeintellicode \
|
| 114 |
+
--install-extension vscjava.vscode-java-debug \
|
| 115 |
+
--install-extension vscjava.vscode-java-dependency \
|
| 116 |
+
--install-extension vscjava.vscode-java-pack \
|
| 117 |
+
--install-extension vscjava.vscode-java-test \
|
| 118 |
+
--install-extension vscjava.vscode-maven \
|
| 119 |
+
--install-extension vscodevim.vim \
|
| 120 |
+
--install-extension wayou.vscode-todo-highlight \
|
| 121 |
+
--install-extension webfreak.debug \
|
| 122 |
+
--install-extension wix.vscode-import-cost \
|
| 123 |
+
--install-extension wmaurer.change-case \
|
| 124 |
+
--install-extension zhuangtongfa.material-theme
|
| 125 |
+
|
| 126 |
+
# 暴露 Visual Studio Code 服务版的默认端口
|
| 127 |
+
EXPOSE 7860
|
| 128 |
+
|
| 129 |
+
# 启动 Visual Studio Code 服务版
|
| 130 |
+
ENTRYPOINT ["/bin/sh", "-c", "exec /usr/local/vscode/bin/code-server --extensions-dir /home/ubuntu/.vscode --port=7860 --connection-token=${PASSWORD} --host=0.0.0.0 --accept-server-license-terms", "--"]
|