2025-01-23 02:58:00 +00:00
|
|
|
FROM mcr.microsoft.com/devcontainers/base:bookworm
|
|
|
|
|
2025-01-23 05:15:57 +00:00
|
|
|
ARG USERNAME=vscode
|
|
|
|
|
2025-01-23 02:58:00 +00:00
|
|
|
# Install things I need for Caddy and such
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
--mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
|
|
rm -f \
|
|
|
|
/etc/apt/apt.conf.d/docker-clean \
|
|
|
|
/etc/apt/apt.conf.d/docker-no-languages \
|
|
|
|
&& apt-get update -y && apt-get upgrade -y \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
debian-keyring \
|
|
|
|
debian-archive-keyring \
|
|
|
|
apt-transport-https \
|
|
|
|
gnupg
|
|
|
|
|
|
|
|
RUN --mount=type=bind,target=/tmp/caddy.key,source=./configs/keys/caddy.key \
|
|
|
|
gpg -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg --dearmor /tmp/caddy.key
|
|
|
|
COPY ./configs/apt/sources.list.d/caddy-stable.list /etc/apt/sources.list
|
|
|
|
RUN \
|
|
|
|
--mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
|
|
apt-get update -y \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2025-01-23 04:38:52 +00:00
|
|
|
caddy
|
|
|
|
|
|
|
|
RUN mkdir -p /workspaces/kredens && chown vscode:vscode /workspaces
|
|
|
|
WORKDIR /workspaces/kredens
|
2025-01-23 05:15:57 +00:00
|
|
|
|
|
|
|
# Persist history
|
|
|
|
|
|
|
|
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
|
|
|
|
&& mkdir /commandhistory \
|
|
|
|
&& touch /commandhistory/.bash_history \
|
|
|
|
&& chown -R $USERNAME /commandhistory \
|
|
|
|
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"
|