Skip to content

Instantly share code, notes, and snippets.

@rasta-mouse
Created May 31, 2025 10:25
Show Gist options
  • Select an option

  • Save rasta-mouse/d18545291827b02010d2c0d8e285110b to your computer and use it in GitHub Desktop.

Select an option

Save rasta-mouse/d18545291827b02010d2c0d8e285110b to your computer and use it in GitHub Desktop.
code-server dockerfile
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# system dependencies
RUN apt-get update && apt-get install -y \
curl wget gnupg2 software-properties-common apt-transport-https \
git unzip build-essential clang lldb lld \
nasm yasm \
libssl-dev libcurl4-openssl-dev libelf-dev \
ca-certificates sudo libicu-dev \
&& rm -rf /var/lib/apt/lists/*
# coder user
RUN useradd -m coder \
&& echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER coder
WORKDIR /home/coder
# dotnet
RUN curl -fsSL https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh --channel STS \
&& rm dotnet-install.sh
ENV PATH="/home/coder/.dotnet:${PATH}"
# rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# code server
RUN curl -fsSL https://code-server.dev/install.sh | sh
# extensions
RUN code-server --install-extension vadimcn.vscode-lldb \
&& code-server --install-extension rust-lang.rust-analyzer \
&& code-server --install-extension PKief.material-icon-theme \
&& code-server --install-extension usernamehw.errorlens \
&& code-server --install-extension muhammad-sammy.csharp \
&& code-server --install-extension dracula-theme.theme-dracula \
&& code-server --install-extension oderwat.indent-rainbow \
&& code-server --install-extension 13xforever.language-x86-64-assembly \
&& code-server --install-extension llvm-vs-code-extensions.vscode-clangd
# preferences
RUN mkdir -p /home/coder/.local/share/code-server/User \
&& printf '%s\n' \
'{' \
' "workbench.colorTheme": "Dracula Theme",' \
' "telemetry.telemetryLevel": "off",' \
' "terminal.integrated.defaultProfile.linux": "bash",' \
' "workbench.iconTheme": "material-icon-theme",' \
' "terminal.integrated.profiles.linux": {' \
' "bash": {' \
' "path": "/bin/bash"' \
' }' \
' },' \
' "editor.fontSize": 16,' \
' "terminal.integrated.fontSize": 16, ' \
'}' > /home/coder/.local/share/code-server/User/settings.json \
&& chown -R coder:coder /home/coder/.local
# go
EXPOSE 8080
ENTRYPOINT ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "none", "--disable-telemetry"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment