-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (41 loc) · 1.77 KB
/
Dockerfile
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
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2024 Lasath Fernando <devel@lasath.org>
FROM archlinux:latest
# Set environment variables
ARG PROJECT_DIR
ARG PARALLELL_DOWNLOADS=50
# Copy the .env file if needed
# COPY .env $PROJECT_DIR/.env
# Enable parallel downloads for more speed
RUN sed -i "s/ParallelDownloads = 5/ParallelDownloads = $PARALLELL_DOWNLOADS/" /etc/pacman.conf && \
sed -i 's/NoProgressBar//' /etc/pacman.conf
# Set up mirrorlist
RUN echo "Server = https://mirror.rackspace.com/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
# Initialize pacman and install packages
RUN pacman-key --init && \
pacman-key --populate && \
pacman --sync --refresh --noconfirm \
sudo base-devel git ninja rsync openssh \
python-yaml python-setproctitle python-requests python-srcinfo
# Create builder user
RUN useradd -m -s /bin/bash builder && \
echo 'builder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/builder
# Clone the KDE Builder repository and pin to a specific commit
# because there are some issues with the latest version
RUN git clone https://invent.kde.org/sdk/kde-builder.git /kde-builder && \
cd /kde-builder && \
git checkout work/lasath/info && \
ln -s /kde-builder/kde-builder /usr/local/bin
# Set up project directory
RUN mkdir -p $PROJECT_DIR && \
chown -R builder:builder $PROJECT_DIR
ENV PROJECT_DIR=$PROJECT_DIR
# Switch to builder user and run make-packages.sh
USER builder
WORKDIR $PROJECT_DIR
RUN curl https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz | tar xz && \
cd paru-bin && \
makepkg --noconfirm --syncdeps --install
RUN paru -S --noconfirm --needed --skipreview aurutils
COPY make-packages.sh .
CMD ["./make-packages.sh"]