Skip to content

Fedora 41 Dockerfile #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions swift-ci/main/fedora/41/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM fedora:41

RUN groupadd -g 998 build-user && \
useradd -m -r -u 998 -g build-user build-user

RUN yum install -y \
libcurl-devel \
libedit-devel \
libicu-devel \
sqlite-devel \
libuuid-devel \
libxml2-devel \
python3 \
python3-pip \
python3-devel \
python3-distro \
python3-setuptools \
python3-six \
rsync \
swig \
clang \
perl-podlators \
which \
git \
cmake \
zip \
unzip \
diffutils \
libstdc++-devel \
libstdc++-static \
ninja-build \
gnupg

ARG SWIFT_PLATFORM=fedora39
ARG SWIFT_VERSION=6.1
ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release
ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE
ARG SWIFT_WEBROOT=https://download.swift.org
ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION}

ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
SWIFT_VERSION=$SWIFT_VERSION \
SWIFT_BRANCH=$SWIFT_BRANCH \
SWIFT_TAG=$SWIFT_TAG \
SWIFT_WEBROOT=$SWIFT_WEBROOT \
SWIFT_PREFIX=$SWIFT_PREFIX

COPY swift-ci/dependencies/requirements.txt /dependencies/
RUN pip3 install -r /dependencies/requirements.txt

RUN set -e; \
ARCH_NAME="$(rpm --eval '%{_arch}')"; \
url=; \
case "${ARCH_NAME##*-}" in \
'x86_64') \
OS_ARCH_SUFFIX=''; \
;; \
'aarch64') \
OS_ARCH_SUFFIX='-aarch64'; \
;; \
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
esac; \
SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \
&& SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \
&& SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
&& echo $SWIFT_BIN_URL \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
&& curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \
&& gpg --batch --verify swift.tar.gz.sig swift.tar.gz \
# - Unpack the toolchain, set libs permissions, and clean up.
&& mkdir -p $SWIFT_PREFIX \
&& tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \
&& chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \
&& rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz

ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}"

USER build-user

WORKDIR /home/build-user