2024-11-03 21:07:43 +00:00
|
|
|
FROM codercom/code-server:latest
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
ENV DEFAULT_WORKSPACE=/workspace
|
|
|
|
ENV DOCKER_USER=code
|
|
|
|
|
|
|
|
# Define persistent volumes for /home and /workspace
|
|
|
|
VOLUME ["/home", "/workspace"]
|
|
|
|
|
2025-01-02 06:22:58 +00:00
|
|
|
# Add Docker command support to image
|
|
|
|
RUN apt-get update && apt-get install ca-certificates curl \
|
|
|
|
&& install -m 0755 -d /etc/apt/keyrings \
|
|
|
|
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
|
|
|
|
&& chmod a+r /etc/apt/keyrings/docker.asc
|
|
|
|
RUN echo \
|
|
|
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
|
|
|
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
|
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \
|
|
|
|
&& sudo apt-get update
|
|
|
|
|
|
|
|
RUN apt-get install -y --no-install-recommends \
|
|
|
|
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
|
|
|
2024-11-03 21:07:43 +00:00
|
|
|
# Install development tools with optimization for minimal package installs
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
wget \
|
|
|
|
vim \
|
|
|
|
zsh \
|
|
|
|
tmux \
|
|
|
|
htop \
|
|
|
|
tree \
|
|
|
|
jq \
|
|
|
|
unzip \
|
|
|
|
zip \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
make \
|
|
|
|
cmake \
|
|
|
|
python3 \
|
|
|
|
python3-pip \
|
|
|
|
python3-venv && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2024-11-03 21:12:07 +00:00
|
|
|
|
2024-11-11 19:37:20 +00:00
|
|
|
## Workaround as above somehow removed the entrypoint.sh
|
|
|
|
RUN curl -o /usr/bin/entrypoint.sh https://raw.githubusercontent.com/coder/code-server/main/ci/release-image/entrypoint.sh && \
|
|
|
|
chmod +x /usr/bin/entrypoint.sh
|
2024-11-03 21:12:07 +00:00
|
|
|
|
2025-01-02 06:22:58 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "/workspace"]
|