fix(devcontainer): switch to debian 13 (#1357)

* fix(devcontainer): switch to debian 13

* potato potato
This commit is contained in:
beerpsi
2025-09-17 00:42:44 +01:00
committed by GitHub
parent 4f3e154e7b
commit a691804cc4
2 changed files with 33 additions and 26 deletions
+33 -26
View File
@@ -1,30 +1,36 @@
# For use via `devcontainer.json`. The docker-compose-dev file sets some other
# important variables.
# we use ubuntu because 'just' isn't available on debian 13
# haha.. haha...
FROM ubuntu:24.10
FROM debian:13
WORKDIR /tachi
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
# essentials
git npm locales sudo \
# docs pythonisms
python-is-python3 pip mkdocs mkdocs-material \
# nice to haves
gh fish just fzf curl wget parallel neovim fd-find bat \
# uninstall lynx so people don't get a CLI browser that can't load anything when they do `gh auth login`
&& apt-get purge -y lynx
# essentials
RUN apt install -y git npm locales sudo
# so apt doesn't complain about the lack of a dialog-like program
ENV DEBIAN_FRONTEND=readline
# `fd` is called `fdfind` on debian. Awesome.
RUN ln -s $(which fdfind) /usr/bin/fd
# setup locales
# https://stackoverflow.com/questions/28405902/how-to-set-the-locale-inside-a-debian-ubuntu-docker-container
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# nodeisms
RUN npm install --silent -g pnpm@8.15.6
# docs pythonisms
RUN apt install -y python-is-python3 pip mkdocs mkdocs-material
# https://github.com/python-babel/babel/issues/990
# it wouldn't be python without needing absurd global state manipulation to fix
# an incoherent error message
@@ -33,23 +39,24 @@ RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime
# Fix locale issue perl repeatedly complains about
RUN echo "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8" > /etc/default/locale
# nice to haves
RUN apt install -y gh fish just fzf curl wget parallel neovim fd-find bat
# create tachi user and give them sudo
RUN addgroup --gid 1000 tachi \
&& adduser --disabled-password --uid 1000 --gid 1000 --home /home/tachi tachi \
&& echo "tachi ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
# `fd` is called `find-fd` on ubuntu. Awesome.
RUN ln -s $(which fdfind) /usr/bin/fd
# Make the /tachi working directory owned by our user instead of root. Docker volumes
# are mounted as root UNLESS the folder already exists inside the host and has non-root
# ownership. This is the only way to declare a volume in docker has non-root ownership.
# Unbelievably obscure.
RUN chown -R tachi:tachi /tachi
# rename ubuntu user to tachi and give them sudo
RUN usermod -l tachi ubuntu && \
usermod -d /home/tachi -m tachi && \
echo "tachi ALL = NOPASSWD : ALL" >> /etc/sudoers
USER tachi
# Docker volumes are mounted as root UNLESS the folder already exists inside the host
# and has non-root ownership. This is the only way to declare a volume in docker has
# non-root ownership. Unbelievably obscure.
RUN mkdir node_modules && \
mkdir .pnpm-store && \
chown tachi:1000 node_modules .pnpm-store
# see above comment about non-root volumes
RUN mkdir node_modules .pnpm-store
# make pnpm be quiet about new versions
RUN echo "update-notifier=false" >> /home/tachi/.npmrc
# keep container alive indefinitely
CMD ["/bin/fish"]