Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +196 -0
Dockerfile
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Start with a clean, modern base image
|
2 |
+
FROM archlinux:latest
|
3 |
+
|
4 |
+
# --- 1. System Setup & Package Repositories (as root) ---
|
5 |
+
# Add repositories for a wider selection of packages, including the AUR
|
6 |
+
RUN echo -e "[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
|
7 |
+
&& echo -e "[archlinuxcn]\nServer = https://mirrors.aliyun.com/archlinuxcn/\$arch" >> /etc/pacman.conf \
|
8 |
+
&& echo -e "[chaotic-aur]\nServer = https://geo-mirror.chaotic.cx/\$repo/\$arch" >> /etc/pacman.conf
|
9 |
+
|
10 |
+
# CORRECTED KEYRING SETUP (Final, Official Method):
|
11 |
+
# This uses the official documented procedure for bootstrapping trust.
|
12 |
+
RUN pacman -Syu --noconfirm --needed git \
|
13 |
+
# First, receive and locally sign the key for the Chaotic-AUR maintainer.
|
14 |
+
&& pacman-key --init \
|
15 |
+
&& pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com \
|
16 |
+
&& pacman-key --lsign-key 3056513887B78AEB \
|
17 |
+
# Then, use pacman -U to install the keyring and mirrorlist directly from the URL. This is the most robust method.
|
18 |
+
&& pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' \
|
19 |
+
# Now, handle the archlinuxcn keyring.
|
20 |
+
&& pacman-key --lsign-key "[email protected]" \
|
21 |
+
&& pacman -Sy --noconfirm archlinuxcn-keyring \
|
22 |
+
# Final sync and update to ensure everything is consistent
|
23 |
+
&& pacman -Syu --noconfirm
|
24 |
+
|
25 |
+
# --- 2. Install System-Level Packages (as root) ---
|
26 |
+
# Now that keys are trusted, install yay and all other essential development tools
|
27 |
+
RUN pacman -S --noconfirm yay \
|
28 |
+
&& yay -S --noconfirm \
|
29 |
+
# --- The Core Application ---
|
30 |
+
code-server \
|
31 |
+
# --- Core Build & System Tools ---
|
32 |
+
base-devel \
|
33 |
+
clang \
|
34 |
+
cmake \
|
35 |
+
gcc \
|
36 |
+
git \
|
37 |
+
git-lfs \
|
38 |
+
openssh \
|
39 |
+
pkgconf \
|
40 |
+
# --- Language Toolchains ---
|
41 |
+
go \
|
42 |
+
tinygo \
|
43 |
+
rust \
|
44 |
+
zig \
|
45 |
+
deno \
|
46 |
+
nodejs \
|
47 |
+
npm \
|
48 |
+
bun \
|
49 |
+
python \
|
50 |
+
python-pip \
|
51 |
+
rye \
|
52 |
+
# --- CLI Quality of Life ---
|
53 |
+
aria2 \
|
54 |
+
curl \
|
55 |
+
direnv \
|
56 |
+
fish \
|
57 |
+
fisher \
|
58 |
+
fzf \
|
59 |
+
htop \
|
60 |
+
jq \
|
61 |
+
p7zip \
|
62 |
+
ripgrep \
|
63 |
+
screen \
|
64 |
+
tldr \
|
65 |
+
unzip \
|
66 |
+
wget \
|
67 |
+
zip \
|
68 |
+
# --- AI & Cloud Tools ---
|
69 |
+
github-cli \
|
70 |
+
cloudflared \
|
71 |
+
# --- Misc ---
|
72 |
+
nix \
|
73 |
+
pkgfile \
|
74 |
+
&& yay -Scc --noconfirm \
|
75 |
+
&& rm -rf /var/cache/pacman/*
|
76 |
+
|
77 |
+
# --- 3. Install Global NPM Packages (as root) ---
|
78 |
+
# Install global command-line tools using npm
|
79 |
+
RUN npm install -g \
|
80 |
+
pnpm \
|
81 |
+
@google/gemini-cli \
|
82 |
+
@anthropic-ai/claude-code \
|
83 |
+
@musistudio/claude-code-router \
|
84 |
+
opencode-ai@latest
|
85 |
+
|
86 |
+
# --- 4. System Configuration (as root) ---
|
87 |
+
# Install git-lfs for large file support in git
|
88 |
+
RUN git lfs install
|
89 |
+
# Set up pnpm
|
90 |
+
RUN corepack prepare pnpm@latest && corepack enable pnpm
|
91 |
+
# Update pkgfile database
|
92 |
+
RUN pkgfile --update
|
93 |
+
|
94 |
+
# --- 5. User Setup (as root) ---
|
95 |
+
# Create the user 'arctic' with a home directory and set the default shell to fish
|
96 |
+
RUN useradd -m -s /usr/bin/fish arctic
|
97 |
+
|
98 |
+
# --- 6. Switch to User & User-Specific Setup ---
|
99 |
+
# All subsequent commands will run as the 'arctic' user
|
100 |
+
USER arctic
|
101 |
+
WORKDIR /home/arctic
|
102 |
+
|
103 |
+
# Create the .ssh directory to prevent warnings from fish plugins
|
104 |
+
RUN mkdir -p /home/arctic/.ssh
|
105 |
+
|
106 |
+
# Install plugins for the fish shell
|
107 |
+
RUN plugins=( \
|
108 |
+
"danhper/fish-ssh-agent" \
|
109 |
+
"jethrokuan/z" \
|
110 |
+
"franciscolourenco/done" \
|
111 |
+
"jorgebucaran/autopair.fish" \
|
112 |
+
) \
|
113 |
+
&& for plugin in "${plugins[@]}"; do \
|
114 |
+
fish -c "fisher install $plugin"; \
|
115 |
+
done
|
116 |
+
|
117 |
+
# Set up rye (Python environment manager)
|
118 |
+
RUN rye toolchain register /usr/bin/python
|
119 |
+
|
120 |
+
# --- 7. VS Code / Code-Server Setup (as user) ---
|
121 |
+
# Create the config directory and file for code-server
|
122 |
+
RUN mkdir -p /home/arctic/.config/code-server/ \
|
123 |
+
&& touch /home/arctic/.config/code-server/config.yaml \
|
124 |
+
&& echo -e "bind-addr: 0.0.0.0:8080\nauth: password\ncert: false" > /home/arctic/.config/code-server/config.yaml
|
125 |
+
|
126 |
+
# Install the selected VS Code extensions
|
127 |
+
RUN extensions=( \
|
128 |
+
# General & UI
|
129 |
+
"aaron-bond.better-comments" \
|
130 |
+
"alefragnani.bookmarks" \
|
131 |
+
"antfu.browse-lite" \
|
132 |
+
"codezombiech.gitignore" \
|
133 |
+
"davidanson.vscode-markdownlint" \
|
134 |
+
"dbaeumer.vscode-eslint" \
|
135 |
+
"eamodio.gitlens" \
|
136 |
+
"editorconfig.editorconfig" \
|
137 |
+
"esbenp.prettier-vscode" \
|
138 |
+
"formulahendry.auto-close-tag" \
|
139 |
+
"formulahendry.auto-rename-tag" \
|
140 |
+
"gruntfuggly.todo-tree" \
|
141 |
+
"mhutchie.git-graph" \
|
142 |
+
"mkhl.direnv" \
|
143 |
+
"oderwat.indent-rainbow" \
|
144 |
+
"redhat.vscode-yaml" \
|
145 |
+
"tamasfe.even-better-toml" \
|
146 |
+
"timonwong.shellcheck" \
|
147 |
+
"wayou.vscode-todo-highlight" \
|
148 |
+
# Python
|
149 |
+
"ms-python.python" \
|
150 |
+
"ms-python.vscode-pylance" \
|
151 |
+
"ms-python.black-formatter" \
|
152 |
+
"ms-toolsai.jupyter" \
|
153 |
+
"ms-toolsai.jupyter-keymap" \
|
154 |
+
"ms-toolsai.jupyter-renderers" \
|
155 |
+
"njpwerner.autodocstring" \
|
156 |
+
# AI Assistants
|
157 |
+
"saoudrizwan.claude-dev" \
|
158 |
+
"RooVeterinaryInc.roo-cline" \
|
159 |
+
"Google.geminicodeassist" \
|
160 |
+
"robertpiosik.gemini-coder" \
|
161 |
+
# Git & GitHub
|
162 |
+
"donjayamanne.githistory" \
|
163 |
+
"github.codespaces" \
|
164 |
+
"github.remotehub" \
|
165 |
+
"github.vscode-github-actions" \
|
166 |
+
# C/C++/Rust/Go
|
167 |
+
"ms-vscode.cpptools-extension-pack" \
|
168 |
+
"rust-lang.rust-analyzer" \
|
169 |
+
"golang.go" \
|
170 |
+
"msyrus.go-doc" \
|
171 |
+
"swellaby.rust-pack" \
|
172 |
+
"twxs.cmake" \
|
173 |
+
# Web & Node.js
|
174 |
+
"antfu.vite" \
|
175 |
+
"christian-kohler.npm-intellisense" \
|
176 |
+
"christian-kohler.path-intellisense" \
|
177 |
+
"misterj.vue-volar-extention-pack" \
|
178 |
+
"vue.volar" \
|
179 |
+
# Other Tools
|
180 |
+
"bbenoist.nix" \
|
181 |
+
"jeff-hykin.better-dockerfile-syntax" \
|
182 |
+
"redhat.vscode-xml" \
|
183 |
+
"syler.sass-indented" \
|
184 |
+
"visualstudioexptteam.vscodeintellicode" \
|
185 |
+
"vitest.explorer" \
|
186 |
+
) \
|
187 |
+
&& for extension in "${extensions[@]}"; do \
|
188 |
+
code-server --config /home/arctic/.config/code-server/config.yaml --install-extension "$extension"; \
|
189 |
+
done
|
190 |
+
|
191 |
+
# --- 8. Finalization ---
|
192 |
+
# Expose the port that code-server will run on
|
193 |
+
EXPOSE 8080
|
194 |
+
|
195 |
+
# The command to run when the container starts
|
196 |
+
CMD ["code-server", "--config", "/home/arctic/.config/code-server/config.yaml"]
|