You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.1 KiB

FROM archlinux/base:latest AS build
# Install tools required for project
# Run `docker build --no-cache .` to update dependencies
RUN mkdir -p /build/ /repo/ /var/cache/pacman/pkg/ && chown nobody: /build/ /repo/ && \
echo -e '[aur]\nSigLevel = Never\nServer = file:///repo' >> /etc/pacman.conf && repo-add /repo/aur.db.tar.gz && \
echo 'COMPRESSXZ=(xz -c -z - --threads=0)' >> /etc/makepkg.conf && \
pacman -Syu --noconfirm base sudo base-devel && \
echo -e 'nobody ALL= NOPASSWD: /usr/bin/pacman\nnobody ALL= NOPASSWD: /usr/bin/makepkg' > /etc/sudoers.d/nobody
COPY . /build/
WORKDIR /build/src/
RUN chown -R nobody: /build/ /repo/ && /build/.docker/ /build/src /repo
# This results in a single layer image
FROM nginx:stable-alpine
COPY --from=build /repo/ /usr/share/nginx/html
RUN rm /usr/share/nginx/html/index.html /usr/share/nginx/html/50x.html && chown -R nginx: /usr/share/nginx/html && \
sed -i 's@root /usr/share/nginx/html;@root /usr/share/nginx/html; autoindex on;@' /etc/nginx/conf.d/default.conf