diff --git a/archlinux/Dockerfile b/archlinux/Dockerfile index 39954c0..384f481 100644 --- a/archlinux/Dockerfile +++ b/archlinux/Dockerfile @@ -1,33 +1,21 @@ FROM archlinux:latest LABEL maintainer "TAKANO Mitsuhiro " -ENV BUILD_DIR=/build-kernel/build - -RUN mkdir /build-kernel -RUN mkdir /build-kernel/build -RUN mkdir /build-kernel/zst-pkg - -RUN yes | pacman -Sy git - -RUN yes | pacman -S asp base-devel -RUN yes | pacman -S pacman-contrib +RUN pacman-db-upgrade +RUN pacman -Syyu --noconfirm +RUN pacman -S --noconfirm git +RUN pacman -S --noconfirm asp base-devel +RUN pacman -S --noconfirm pacman-contrib RUN pacman -Scc RUN useradd takano32 +RUN mkdir /build-kernel RUN mkdir /home/takano32 RUN chown -R takano32.takano32 /build-kernel /home/takano32 RUN echo "takano32 ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/takano32 ENV SUDO="sudo -u takano32" -RUN cd $BUILD_DIR && $SUDO asp update linux -RUN cd $BUILD_DIR && $SUDO asp export linux -RUN cd $BUILD_DIR/linux && $SUDO updpkgsums -RUN cd $BUILD_DIR/linux && yes | $SUDO makepkg -seo -RUN $SUDO git config --global http.version HTTP/1.1 -RUN $SUDO git config --global http.postBuffer 524288000 -RUN while :; do cd $BUILD_DIR/linux && $SUDO makepkg -o --skippgpcheck && break || sleep 5; done - COPY ./archlinux/entrypoint.sh / RUN chmod 755 /entrypoint.sh EXPOSE 8000 diff --git a/archlinux/entrypoint.sh b/archlinux/entrypoint.sh index c6099e0..805ba4b 100644 --- a/archlinux/entrypoint.sh +++ b/archlinux/entrypoint.sh @@ -1,23 +1,28 @@ #!/bin/bash set -eux +BUILD_DIR=/build-kernel/build SUDO="sudo -u takano32" -chown -R takano32:takano32 /build-kernel/build -$SUDO mkdir -p /build-kernel/build/linux -$SUDO rm -rf /build-kernel/build/linux -$SUDO mkdir -p /build-kernel/build/linux -cd /build-kernel/build/linux +mkdir -p $BUILD_DIR +chown -R takano32:takano32 $BUILD_DIR + +cd $BUILD_DIR $SUDO asp update linux $SUDO asp export linux -$SUDO cp -a linux/* . -$SUDO rm -rf linux -# `makepkg` in `/build-kernel/bulid/linux` +cd $BUILD_DIR/linux +$SUDO updpkgsums && yes | $SUDO makepkg -seo +$SUDO git config --global http.version HTTP/1.1 +$SUDO git config --global http.postBuffer 524288000 +while :; do $SUDO makepkg -o --skippgpcheck && break || sleep 5; done + +# `makepkg` in `$BUILD_DIR/linux` $SUDO makepkg --skippgpcheck -cd /build-kernel/build +cd $BUILD_DIR mv linux/src/archlinux-linux/Documentation/output ../htmldocs +mkdir /build-kernel/zst-pkg mv linux/*.zst ../zst-pkg cd .. @@ -25,4 +30,3 @@ if ! "$CI"; then python3 -m http.server fi -