67 lines
1.7 KiB
Docker
67 lines
1.7 KiB
Docker
FROM archlinux:latest
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# 初始化密钥和软件源
|
|
RUN pacman-key --init && \
|
|
pacman-key --populate archlinux && \
|
|
sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf && \
|
|
printf "\n[archlinuxcn]\nServer = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch\n" >> /etc/pacman.conf && \
|
|
pacman -Syy --noconfirm
|
|
|
|
# 安装基础工具、Buildx 支持和开发环境
|
|
RUN pacman -Syu --noconfirm && \
|
|
pacman -S --noconfirm --disable-download-timeout archlinuxcn-keyring && \
|
|
pacman -S --noconfirm --needed \
|
|
base-devel \
|
|
ca-certificates \
|
|
clang \
|
|
lld \
|
|
libc++ \
|
|
libc++abi \
|
|
cmake \
|
|
ninja \
|
|
curl \
|
|
git \
|
|
python \
|
|
python-pyyaml \
|
|
python-pip \
|
|
paru \
|
|
conan \
|
|
sudo \
|
|
vim \
|
|
supervisor \
|
|
qemu-user-static \
|
|
qemu-user-static-binfmt \
|
|
&& pacman -Scc --noconfirm
|
|
|
|
# AUR 用户(paru 需非 root 运行)
|
|
RUN useradd -m aur && \
|
|
echo "aur ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aur && \
|
|
chmod 0440 /etc/sudoers.d/aur
|
|
|
|
# 安装额外的 AUR 工具
|
|
USER aur
|
|
WORKDIR /home/aur
|
|
RUN paru -S --noconfirm --needed --noprogressbar llvm-mingw-w64-toolchain-ucrt-bin && \
|
|
paru -Scc --noconfirm && \
|
|
rm -rf ~/.cache/paru
|
|
|
|
# 切换回 root
|
|
USER root
|
|
WORKDIR /root
|
|
|
|
# 验证 qemu 和 docker 安装
|
|
RUN qemu-aarch64-static --version && \
|
|
qemu-x86_64-static --version && \
|
|
docker --version
|
|
|
|
# 创建必要目录
|
|
RUN mkdir -p /data /etc/supervisor/conf.d /var/log/supervisor
|
|
|
|
# 设置工作目录
|
|
WORKDIR /data
|
|
|
|
# 使用自定义入口点
|
|
ENTRYPOINT ["/data/entrypoint.sh"]
|