Files
security-command.org/sandbox/Dockerfile
T

28 lines
1011 B
Docker

FROM debian:trixie-slim
ENV LANG=C.UTF-8
# Slim images exclude man pages through a dpkg path filter. Removing it and
# reinstalling the preinstalled essentials restores their man pages.
RUN rm -f /etc/dpkg/dpkg.cfg.d/docker \
&& apt-get update \
&& apt-get install -y --no-install-recommends --reinstall \
bash coreutils findutils grep sed \
&& apt-get install -y --no-install-recommends \
gawk less tree file vim-tiny nano man-db manpages jq procps htop \
figlet cowsay fortune-mod fortunes-min sl curl wget \
&& rm -rf /var/lib/apt/lists/*
# Setuid binaries are useless under no-new-privileges, so they are stripped
# to keep the attack surface minimal even if that option is ever dropped.
RUN useradd --uid 1000 --create-home --shell /bin/bash guest \
&& find / -xdev -perm /6000 -type f -exec chmod a-s {} +
COPY etc/ /etc/
COPY --chmod=0755 bin/status /usr/local/bin/status
ENV PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
USER guest
WORKDIR /home/guest
CMD ["/bin/bash", "-l"]