-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.arch-rolling
55 lines (45 loc) · 1.53 KB
/
Dockerfile.arch-rolling
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Dockerfile for Arch rolling release GNAT
FROM archlinux
# Start with forcing an up-to-date-rolling distro with updated credentials
RUN pacman-key --init && \
pacman -Syy --noconfirm && \
pacman -S --noconfirm archlinux-keyring && \
pacman -Suyy --noconfirm
# First curl is a temporary workaround for https://www.reddit.com/r/archlinux/comments/lek2ba/arch_linux_on_docker_ci_could_not_find_or_read/
# RUN curl -fsSL "https://repo.archlinuxcn.org/x86_64/glibc-linux4-2.33-4-x86_64.pkg.tar.zst" | bsdtar -C / -xvf -
RUN pacman --noconfirm -Syu \
base-devel \
bash \
curl \
git \
gcc-ada \
jq \
make \
mercurial \
python \
python-pip \
rsync \
subversion \
sudo \
unzip \
wget \
fakeroot
# gprbuild is not in official Arch repositories : it must be built separately from AUR
# Add a 'build' user to be able to create the package
RUN useradd --no-create-home --shell=/bin/false build && usermod -L build
RUN echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Force generation of .tar.zst packages
RUN echo "PKGEXT='.pkg.tar.zst'" >> /etc/makepkg.conf
# Build the package as 'build' user
USER build
RUN cd /tmp && \
git clone https://aur.archlinux.org/gprbuild-bootstrap.git && \
cd /tmp/gprbuild-bootstrap && \
makepkg -s
# Install the package as 'root' user
USER root
RUN pacman --noconfirm -U /tmp/gprbuild-bootstrap/*.pkg.tar.zst
RUN cat /etc/os-release && \
gnat --version && \
gprbuild --version