archlinux/base/Dockerfile

50 lines
1.4 KiB
Docker

# syntax = docker/dockerfile:1
FROM quay.io/archlinux/archlinux:base-devel
USER root
# Build ARG for additional packages to install (eg, openssh)
ARG addpkg
# Build ARG: use "root" for debugging
ARG debug
# Copy mirrorlist
COPY mirrorlist /etc/pacman.d/mirrorlist
# Copy app folder
COPY app /app
# Install packages
RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \
pacman-key --init \
&& sed -i '/ParallelDownloads/c ParallelDownloads = 10' /etc/pacman.conf \
&& pacman -Sy --ask 4 archlinux-keyring \
&& pacman -Su --ask 4 --needed ${addpkg} \
sudo bash bash-completion \
inetutils python-numpy python-setuptools \
nginx-mainline \
&& pacman -Scc --ask 4 \
&& useradd --create-home --gid users --shell /usr/bin/bash user \
&& printf '%s\n' 'user ALL=(ALL:ALL) NOPASSWD: MISCELLANEOUS, /usr/bin/nginx' \
'Defaults lecture = never' >/etc/sudoers.d/zz-DOCKER \
&& 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 \
&& mkdir -p /app/nginx /app/logs \
&& chown -R user:users /app
# Default environment
USER ${debug:-user}
WORKDIR /home/user
ENV HOME=/home/user
ENV DISPLAY=:0
ENV SHELL=/usr/bin/bash
ENV PS1="[\u@\h \W \$?]\$ "
# Expose nginx port for VNC webui
EXPOSE 6900
# Docker entrypoint
ENTRYPOINT ["/app/entrypoint"]