Skip to content

Commit 5332094

Browse files
committed
Fedora 41 Dockerfile
1 parent 62b1e50 commit 5332094

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

swift-ci/main/fedora/41/Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM fedora:41
2+
3+
RUN groupadd -g 998 build-user && \
4+
useradd -m -r -u 998 -g build-user build-user
5+
6+
RUN yum install -y \
7+
libcurl-devel \
8+
libedit-devel \
9+
libicu-devel \
10+
sqlite-devel \
11+
libuuid-devel \
12+
libxml2-devel \
13+
python3 \
14+
python3-pip \
15+
python3-devel \
16+
python3-distro \
17+
python3-setuptools \
18+
python3-six \
19+
rsync \
20+
swig \
21+
clang \
22+
perl-podlators \
23+
which \
24+
git \
25+
cmake \
26+
zip \
27+
unzip \
28+
diffutils \
29+
libstdc++-devel \
30+
libstdc++-static \
31+
ninja-build \
32+
gnupg
33+
34+
ARG SWIFT_PLATFORM=fedora39
35+
ARG SWIFT_VERSION=6.1
36+
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
37+
ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE
38+
ARG SWIFT_WEBROOT=https://download.swift.org
39+
ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION}
40+
41+
ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
42+
SWIFT_VERSION=$SWIFT_VERSION \
43+
SWIFT_BRANCH=$SWIFT_BRANCH \
44+
SWIFT_TAG=$SWIFT_TAG \
45+
SWIFT_WEBROOT=$SWIFT_WEBROOT \
46+
SWIFT_PREFIX=$SWIFT_PREFIX
47+
48+
COPY swift-ci/dependencies/requirements.txt /dependencies/
49+
RUN pip3 install -r /dependencies/requirements.txt
50+
51+
RUN set -e; \
52+
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
53+
url=; \
54+
case "${ARCH_NAME##*-}" in \
55+
'x86_64') \
56+
OS_ARCH_SUFFIX=''; \
57+
;; \
58+
'aarch64') \
59+
OS_ARCH_SUFFIX='-aarch64'; \
60+
;; \
61+
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
62+
esac; \
63+
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
64+
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
65+
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
66+
&& echo $SWIFT_BIN_URL \
67+
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
68+
&& export GNUPGHOME="$(mktemp -d)" \
69+
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
70+
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
71+
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
72+
# - Unpack the toolchain, set libs permissions, and clean up.
73+
&& mkdir -p $SWIFT_PREFIX \
74+
&& tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \
75+
&& chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \
76+
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz
77+
78+
ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}"
79+
80+
USER build-user
81+
82+
WORKDIR /home/build-user

0 commit comments

Comments
 (0)