-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.debian
More file actions
52 lines (44 loc) · 2.24 KB
/
Dockerfile.debian
File metadata and controls
52 lines (44 loc) · 2.24 KB
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
FROM debian:11
ARG TARGETARCH
ARG RPM_ARCH
ARG UID=1000
ARG GID=1000
RUN if [ -z "${RPM_ARCH}" ]; then \
case "${TARGETARCH:-$(dpkg --print-architecture 2>/dev/null || uname -m)}" in \
arm64|aarch64) echo aarch64 > /tmp/rpm_arch ;; \
*) echo x86_64 > /tmp/rpm_arch ;; \
esac; \
else echo "${RPM_ARCH}" > /tmp/rpm_arch; fi
RUN apt-get update && \
apt-get install -y ruby build-essential jq curl gzip sudo git gnupg tar zstd python3 python3-requests llvm \
bison re2c flex autoconf automake autopoint libtool pkg-config && \
apt-get upgrade -y && \
gem install --no-document fpm && \
mkdir -p /usr/lib/bfd-plugins && \
PLUGIN=$(find /usr/lib /usr/lib64 -name LLVMgold.so 2>/dev/null | head -1) && \
[ -n "$PLUGIN" ] && ln -sf "$PLUGIN" /usr/lib/bfd-plugins/LLVMgold.so
RUN curl -o cmake.tar.gz -fsSL "https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$(uname -m).tar.gz" && \
tar -xzf cmake.tar.gz -C /usr/local --strip-components=1 && \
rm cmake.tar.gz
RUN RPM_ARCH=$(cat /tmp/rpm_arch) && \
curl -L "https://files.henderkes.com/${RPM_ARCH}-linux/php" -o /usr/local/bin/php && \
chmod +x /usr/local/bin/php && \
curl -sS https://raw.githubusercontent.com/composer/getcomposer.org/f3108f64b4e1c1ce6eb462b159956461592b3e3e/web/installer | php -- --quiet && \
mv composer.phar /usr/local/bin/composer
RUN U=$(id -un 1000 2>/dev/null || echo "") && \
if [ -z "$U" ]; then \
groupadd -g 1000 builder && useradd -m -u 1000 -g 1000 -s /bin/bash builder && U=builder; \
fi && \
echo "$U ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder
# Pre-install SPC's go-xcaddy and zig packages so workflows don't redownload them.
ENV PKG_ROOT_PATH=/opt/spc-pkgroot
COPY composer.json composer.lock /tmp/spc-bootstrap/
RUN cd /tmp/spc-bootstrap && \
mkdir -p src && \
composer install --no-interaction --prefer-dist --no-progress --no-scripts && \
php vendor/bin/spc install-pkg go-xcaddy && \
php vendor/bin/spc install-pkg zig && \
SPC_TARGET=native-native-musl php vendor/bin/spc doctor --auto-fix --debug && \
rm -rf /tmp/spc-bootstrap /root/.composer /root/.cache && \
chown -R ${UID}:${GID} "$PKG_ROOT_PATH"
WORKDIR /build