-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 00533ee.
- Loading branch information
Showing
2 changed files
with
7 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,12 @@ | ||
FROM archlinux/archlinux:base-devel as arch | ||
LABEL maintainer="<[email protected]>" | ||
FROM archlinux/archlinux:base-devel | ||
LABEL maintainer="[email protected]" | ||
|
||
RUN sudo pacman-key --init | ||
|
||
RUN pacman -Syu --needed --noconfirm git | ||
|
||
# add archlinuxcn repo | ||
RUN echo $'[archlinuxcn]\n\ | ||
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch\n\ | ||
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf\ | ||
&& pacman -Sy --noconfirm archlinuxcn-keyring \ | ||
&& pacman-key --populate archlinuxcn | ||
|
||
# create AUR user | ||
ARG user=aur | ||
RUN useradd --create-home $user \ | ||
&& echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user | ||
USER $user | ||
WORKDIR /home/$user | ||
|
||
# build pacman-static | ||
COPY ./pacman-static.PKGBUILD /home/$user/PKGBUILD | ||
RUN git clone https://aur.archlinux.org/pacman-static.git --depth 1 \ | ||
&& cd pacman-static \ | ||
&& mv ../PKGBUILD . \ | ||
&& makepkg -si --needed --noconfirm --skippgpcheck\ | ||
&& cd | ||
|
||
# build gpg | ||
RUN git clone https://github.com/skeeto/lean-static-gpg gnupg --depth 1 | ||
RUN cd gnupg && ./build.sh | ||
|
||
USER root | ||
|
||
FROM debian:unstable-slim as debian | ||
|
||
RUN apt-get update && apt-get install -y bash-static | ||
|
||
FROM scratch | ||
|
||
# copy over everything pacman needs | ||
COPY --from=arch /usr/bin/pacman-static /usr/bin/pacman | ||
COPY --from=arch /etc/pacman.conf /etc/pacman.conf | ||
COPY --from=arch /etc/pacman.d /etc/pacman.d | ||
COPY --from=arch /var/lib/pacman/sync /var/lib/pacman/sync | ||
COPY --from=arch /home/aur/gnupg/gnupg/bin/gpg /usr/bin/gpg | ||
COPY --from=arch /etc/ca-certificates/extracted/tls-ca-bundle.pem \ | ||
/etc/ssl/certs/ca-certificates.crt | ||
|
||
# copy over bash-static from debian | ||
COPY --from=debian /bin/bash-static /usr/bin/bash | ||
|
||
# set shell path | ||
SHELL ["/usr/bin/bash", "-c"] | ||
|
||
CMD ["/usr/bin/bash"] | ||
&& pacman-key --init && pacman-key --populate archlinuxcn\ | ||
&& pacman -Syy --noconfirm git python\ | ||
&& pacman -Scc --noconfirm && rm -rf /var/cache/pacman/pkg/* && rm -rf /var/lib/pacman/sync/*\ | ||
&& rm -rf /usr/share/info/* && rm -rf /usr/share/man/* && rm -rf /usr/share/doc/*\ | ||
&& rm -rf /tmp/* |
This file was deleted.
Oops, something went wrong.