archlinux/base/Dockerfile

45 lines
1.4 KiB
Text
Raw Normal View History

2024-07-24 02:02:53 +00:00
# syntax = docker/dockerfile:1
2024-07-23 19:56:57 -06:00
FROM quay.io/archlinux/archlinux:base-devel
USER root
2024-07-24 02:02:53 +00:00
# Build ARG for additional packages to install (eg, openssh)
ARG addpkg
2024-07-23 19:56:57 -06:00
2024-07-24 02:02:53 +00:00
# Build ARG: use "root" for debugging
ARG debug
2024-07-23 19:56:57 -06:00
# Install packages
COPY mirrorlist /etc/pacman.d/mirrorlist
2024-07-24 02:02:53 +00:00
RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \
pacman-key --init \
2024-07-23 19:56:57 -06:00
&& sed -i '/ParallelDownloads/c ParallelDownloads = 10' /etc/pacman.conf \
&& pacman -Sy --ask 4 archlinux-keyring \
2024-07-24 02:02:53 +00:00
&& pacman -Su --ask 4 --needed ${addpkg} \
sudo bash bash-completion \
2024-07-23 19:56:57 -06:00
inetutils python-numpy python-setuptools \
nginx-mainline \
&& pacman -Scc --ask 4 \
&& useradd --create-home --gid users --shell /usr/bin/bash user \
2024-07-24 02:02:53 +00:00
&& printf '%s\n' 'user ALL=(ALL:ALL) NOPASSWD: MISCELLANEOUS, /usr/bin/nginx' \
'Defaults lecture = never' >/etc/sudoers.d/zz-DOCKER \
2024-07-23 19:56:57 -06:00
&& passwd -l root >/dev/null 2>&1 \
&& sed '/^http {/a\ \
include /app/nginx/\*.conf;\n\ \
types_hash_max_size 4096;\n\ \
server_names_hash_bucket_size 128;\n' -i /etc/nginx/nginx.conf \
2024-07-24 02:02:53 +00:00
&& mkdir -p /app/nginx /app/logs \
2024-07-23 19:56:57 -06:00
&& chown -R user:users /app
# Default environment
2024-07-24 02:02:53 +00:00
USER ${debug:-user}
2024-07-23 19:56:57 -06:00
WORKDIR /home/user
2024-07-24 02:02:53 +00:00
ENV HOME=/home/user
2024-07-23 19:56:57 -06:00
ENV DISPLAY=:0
ENV SHELL=/usr/bin/bash
2024-07-24 02:02:53 +00:00
ENV PS1="[\u@\h \W \$?]\$ "
2024-07-23 19:56:57 -06:00
# Expose nginx port for VNC webui
EXPOSE 6900
# Docker entrypoint
2024-07-24 02:02:53 +00:00
ENTRYPOINT ["/app/entrypoint"]