Skip to content
Merged
Show file tree
Hide file tree
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
69 changes: 69 additions & 0 deletions nightly-main/debian/13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM debian:13

RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
apt-get -q install -y \
binutils-gold \
curl \
gpg \
libicu-dev \
libcurl4-openssl-dev \
libedit-dev \
libsqlite3-dev \
libncurses-dev \
libpython3-dev \
libxml2-dev \
pkg-config \
uuid-dev \
tzdata \
git \
gcc \
libstdc++-14-dev \
&& rm -r /var/lib/apt/lists/*


ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
ARG SWIFT_PLATFORM=debian13
ARG SWIFT_VERSION=6.4
ARG SWIFT_WEBROOT=https://download.swift.org/development
ARG SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM"
ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION}

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

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

RUN set -e; \
ARCH_NAME="$(dpkg --print-architecture)"; \
url=; \
case "${ARCH_NAME##*-}" in \
'amd64') \
OS_ARCH_SUFFIX=''; \
;; \
'arm64') \
OS_ARCH_SUFFIX='-aarch64'; \
;; \
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
esac; \
export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
&& export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}.tar.gz//g") \
&& echo $DOWNLOAD_DIR > .swift_tag \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz.sig \
&& curl -fSsL --compressed https://swift.org/keys/all-keys.asc | gpg --import - \
# - Unpack the toolchain, set libs permissions, and clean up.
&& mkdir -p $SWIFT_PREFIX \
&& tar -xzf latest_toolchain.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \
&& chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz

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

# Print Installed Swift Version
RUN swift --version
78 changes: 78 additions & 0 deletions nightly-main/debian/13/buildx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
FROM debian:13 as Base

ENV DEBIAN_FRONTEND="noninteractive"

RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
apt-get -q install -y \
binutils-gold \
curl \
gpg \
libicu-dev \
libcurl4-openssl-dev \
libedit-dev \
libsqlite3-dev \
libncurses-dev \
libpython3-dev \
libxml2-dev \
pkg-config \
uuid-dev \
tzdata \
git \
gcc \
libstdc++-14-dev \
&& rm -r /var/lib/apt/lists/*


ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
ARG SWIFT_PLATFORM=debian13
ARG SWIFT_VERSION=6.4
ARG SWIFT_WEBROOT=https://download.swift.org/development
ARG SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM"
ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION}

# This is a small trick to enable if/else for arm64 and amd64.
# Because of https://bugs.swift.org/browse/SR-14872 we need adjust tar options.
FROM base AS base-amd64
ARG OS_ARCH_SUFFIX=

FROM base AS base-arm64
ARG OS_ARCH_SUFFIX=-aarch64

FROM base-$TARGETARCH AS final

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

RUN set -e; \
ARCH_NAME="$(dpkg --print-architecture)"; \
url=; \
case "${ARCH_NAME##*-}" in \
'amd64') \
OS_ARCH_SUFFIX=''; \
;; \
'arm64') \
OS_ARCH_SUFFIX='-aarch64'; \
;; \
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
esac; \
export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
&& export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}.tar.gz//g") \
&& echo $DOWNLOAD_DIR > .swift_tag \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz.sig \
&& curl -fSsL --compressed https://swift.org/keys/all-keys.asc | gpg --import - \
# - Unpack the toolchain, set libs permissions, and clean up.
&& mkdir -p $SWIFT_PREFIX \
&& tar -xzf latest_toolchain.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \
&& chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz

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

# Print Installed Swift Version
RUN swift --version
69 changes: 69 additions & 0 deletions nightly-main/debian/13/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM debian:13

LABEL maintainer="Swift Infrastructure <swift-infrastructure@forums.swift.org>"
LABEL description="Docker Container for the Swift programming language"

RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
apt-get -q install -y \
libcurl4 \
libxml2 \
tzdata \
&& rm -r /var/lib/apt/lists/*

# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little

# gpg --keyid-format LONG -k F167DF1ACF9CE069
# pub rsa4096/F167DF1ACF9CE069 2021-11-08 [SC] [expires: 2025-11-09]
# E813C892820A6FA13755B268F167DF1ACF9CE069
# uid [ unknown] Swift Automatic Signing Key #4 <swift-infrastructure@forums.swift.org>
ARG SWIFT_SIGNING_KEY=E813C892820A6FA13755B268F167DF1ACF9CE069
ARG SWIFT_PLATFORM=debian13
ARG SWIFT_WEBROOT=https://download.swift.org/development
ARG SWIFT_WEBROOT="$SWIFT_WEBROOT/$SWIFT_PLATFORM"

ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
SWIFT_PLATFORM=$SWIFT_PLATFORM \
SWIFT_WEBROOT=$SWIFT_WEBROOT

RUN set -e; \
ARCH_NAME="$(dpkg --print-architecture)"; \
case "${ARCH_NAME##*-}" in \
'amd64') \
OS_ARCH_SUFFIX=''; \
;; \
'arm64') \
OS_ARCH_SUFFIX='-aarch64'; \
;; \
*) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \
esac; \
# - Grab curl and gpg here so we cache better up above
export DEBIAN_FRONTEND=noninteractive \
&& apt-get -q update && apt-get -q install -y curl gpg && rm -rf /var/lib/apt/lists/* \
# - Latest Toolchain info
&& export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download:' | sed 's/:[^:\/\/]/=/g') \
&& export $(curl -s ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/latest-build.yml | grep 'download_signature:' | sed 's/:[^:\/\/]/=/g') \
&& export DOWNLOAD_DIR=$(echo $download | sed "s/-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}.tar.gz//g") \
&& echo $DOWNLOAD_DIR > .swift_tag \
# - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fsSL ${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download} -o latest_toolchain.tar.gz \
${SWIFT_WEBROOT}${OS_ARCH_SUFFIX}/${DOWNLOAD_DIR}/${download_signature} -o latest_toolchain.tar.gz.sig \
&& curl -fSsL --compressed https://swift.org/keys/all-keys.asc | gpg --import - \
&& gpg --batch --verify latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
# - Unpack the toolchain, set libs permissions, and clean up.
&& tar -xzf latest_toolchain.tar.gz --directory / --strip-components=1 \
${DOWNLOAD_DIR}-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}/usr/lib/swift/linux \
${DOWNLOAD_DIR}-${SWIFT_PLATFORM}${OS_ARCH_SUFFIX}/usr/libexec/swift/linux \
&& chmod -R o+r /usr/lib/swift /usr/libexec/swift \
&& rm -rf "$GNUPGHOME" latest_toolchain.tar.gz.sig latest_toolchain.tar.gz \
&& apt-get purge --auto-remove -y curl gpg

RUN echo "[ -n \"\${TERM:-}\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash.bashrc; \
( \
printf "################################################################\n"; \
printf "# %-60s #\n" ""; \
printf "# %-60s #\n" "Swift Nightly Docker Image"; \
printf "# %-60s #\n" "Tag: $(cat .swift_tag)"; \
printf "# %-60s #\n" ""; \
printf "################################################################\n" \
) > /etc/motd
92 changes: 92 additions & 0 deletions swift-ci/main/debian/13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
FROM debian:13

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

ENV DEBIAN_FRONTEND="noninteractive"

RUN apt-get -y update && apt-get -y install \
build-essential \
clang \
cmake \
diffutils \
git \
gpg \
icu-devtools \
libcurl4-openssl-dev \
libedit-dev \
libicu-dev \
libncurses-dev \
libpython3-dev \
libsqlite3-dev \
libxml2-dev \
ninja-build \
pkg-config \
python3-pip \
python3-pkg-resources \
python3-setuptools \
python3-psutil \
rsync \
swig \
systemtap-sdt-dev \
tzdata \
uuid-dev \
zip \
libstdc++-14-dev


# Todo: Update SWIFT_PLATFORM to debain13 once 6.3 toolchain exists
ARG SWIFT_PLATFORM=debian12
ARG SWIFT_VERSION=6.3
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 --break-system-packages

RUN set -e; \
ARCH_NAME="$(dpkg --print-architecture)"; \
url=; \
case "${ARCH_NAME##*-}" in \
'amd64') \
OS_ARCH_SUFFIX=''; \
;; \
'arm64') \
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" \
# - Grab curl here so we cache better up above
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
# - 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 --compressed 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 \
&& apt-get purge --auto-remove -y curl

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

RUN echo PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" >> /etc/profile

USER build-user

WORKDIR /home/build-user
Loading