Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +53 -57
Dockerfile
CHANGED
|
@@ -1,62 +1,58 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
curl \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
sudo \
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
#
|
| 19 |
-
RUN
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
RUN
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
"telemetry.enableCrashReporter": false \
|
| 40 |
-
}' > /home/coder/.config/code-server/settings.json
|
| 41 |
-
|
| 42 |
-
# Install Python extension for code-server
|
| 43 |
-
USER coder
|
| 44 |
-
RUN mkdir -p /home/coder/.local/share/code-server/extensions && \
|
| 45 |
-
code-server --install-extension ms-python.python
|
| 46 |
-
|
| 47 |
-
# Change ownership of the configuration and extension directories
|
| 48 |
-
RUN chown -R coder:coder /home/coder/.config && \
|
| 49 |
-
chown -R coder:coder /home/coder/.local
|
| 50 |
-
|
| 51 |
-
# Expose the default code-server port
|
| 52 |
-
EXPOSE 8080
|
| 53 |
-
|
| 54 |
-
# Define a volume for the genz folder
|
| 55 |
-
VOLUME /home/coder/genz
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# syntax=docker/dockerfile:experimental
|
|
|
|
| 2 |
|
| 3 |
+
ARG BASE=debian:12
|
| 4 |
+
FROM scratch AS packages
|
| 5 |
+
COPY release-packages/code-server*.deb /tmp/
|
| 6 |
|
| 7 |
+
FROM $BASE
|
| 8 |
+
|
| 9 |
+
RUN apt-get update \
|
| 10 |
+
&& apt-get install -y \
|
| 11 |
curl \
|
| 12 |
+
dumb-init \
|
| 13 |
+
git \
|
| 14 |
+
git-lfs \
|
| 15 |
+
htop \
|
| 16 |
+
locales \
|
| 17 |
+
lsb-release \
|
| 18 |
+
man-db \
|
| 19 |
+
nano \
|
| 20 |
+
openssh-client \
|
| 21 |
+
procps \
|
| 22 |
sudo \
|
| 23 |
+
vim-tiny \
|
| 24 |
+
wget \
|
| 25 |
+
zsh \
|
| 26 |
+
&& git lfs install \
|
| 27 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
+
# https://wiki.debian.org/Locale#Manually
|
| 30 |
+
RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
|
| 31 |
+
&& locale-gen
|
| 32 |
+
ENV LANG=en_US.UTF-8
|
| 33 |
+
|
| 34 |
+
RUN adduser --gecos '' --disabled-password coder \
|
| 35 |
+
&& echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
| 36 |
+
|
| 37 |
+
RUN ARCH="$(dpkg --print-architecture)" \
|
| 38 |
+
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
| 39 |
+
&& chown root:root /usr/local/bin/fixuid \
|
| 40 |
+
&& chmod 4755 /usr/local/bin/fixuid \
|
| 41 |
+
&& mkdir -p /etc/fixuid \
|
| 42 |
+
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
| 43 |
+
|
| 44 |
+
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
| 45 |
+
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
| 46 |
+
|
| 47 |
+
# Allow users to have scripts run on container startup to prepare workspace.
|
| 48 |
+
# https://github.com/coder/code-server/issues/5177
|
| 49 |
+
ENV ENTRYPOINTD=${HOME}/entrypoint.d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
EXPOSE 8080
|
| 52 |
+
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
|
| 53 |
+
# the uid will remain the same. note: only relevant if -u isn't passed to
|
| 54 |
+
# docker-run.
|
| 55 |
+
USER 1000
|
| 56 |
+
ENV USER=coder
|
| 57 |
+
WORKDIR /home/coder
|
| 58 |
+
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."]
|