|
| 1 | +# syntax=docker/dockerfile:experimental |
| 2 | + |
| 3 | +ARG BASE=opensuse/tumbleweed |
| 4 | +FROM scratch AS packages |
| 5 | +COPY release-packages/code-server*.rpm /tmp/ |
| 6 | + |
| 7 | +FROM $BASE |
| 8 | + |
| 9 | +RUN zypper dup -y \ |
| 10 | + && zypper in -y \ |
| 11 | + curl \ |
| 12 | + git \ |
| 13 | + git-lfs \ |
| 14 | + htop \ |
| 15 | + nano \ |
| 16 | + openssh-clients \ |
| 17 | + procps \ |
| 18 | + wget \ |
| 19 | + zsh \ |
| 20 | + sudo \ |
| 21 | + catatonit \ |
| 22 | + && rm -rf /var/cache/zypp /var/cache/zypper |
| 23 | +RUN git lfs install |
| 24 | + |
| 25 | +ENV LANG=en_US.UTF-8 |
| 26 | +RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf |
| 27 | + |
| 28 | +RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd |
| 29 | + |
| 30 | +RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \ |
| 31 | + && 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 - \ |
| 32 | + && chown root:root /usr/local/bin/fixuid \ |
| 33 | + && chmod 4755 /usr/local/bin/fixuid \ |
| 34 | + && mkdir -p /etc/fixuid \ |
| 35 | + && printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml |
| 36 | + |
| 37 | +COPY ci/release-image/entrypoint-catatonit.sh /usr/bin/entrypoint-catatonit.sh |
| 38 | +RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm |
| 39 | + |
| 40 | +# Allow users to have scripts run on container startup to prepare workspace. |
| 41 | +# https://github.com/coder/code-server/issues/5177 |
| 42 | +ENV ENTRYPOINTD=${HOME}/entrypoint.d |
| 43 | + |
| 44 | +EXPOSE 8080 |
| 45 | +# This way, if someone sets $DOCKER_USER, docker-exec will still work as |
| 46 | +# the uid will remain the same. note: only relevant if -u isn't passed to |
| 47 | +# docker-run. |
| 48 | +USER 1000 |
| 49 | +ENV USER=coder |
| 50 | +WORKDIR /home/coder |
| 51 | +ENTRYPOINT ["/usr/bin/entrypoint-catatonit.sh", "--bind-addr", "0.0.0.0:8080", "."] |
0 commit comments