mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-23 04:34:21 +00:00
Motivation: We periodically drop support for older Swift versions. Now that 5.7 has been released, 5.4 can be dropped. Modifications: - Remove 5.4 specific Package.swift and docker-compose - Update the 5.7 docker-compose to use the released 5.7 and move from focal (2004) to jammy (2204) Results: Minimum Swift version is 5.5
34 lines
1.3 KiB
Docker
34 lines
1.3 KiB
Docker
ARG swift_version=5.7
|
|
ARG ubuntu_version=focal
|
|
ARG base_image=swift:$swift_version-$ubuntu_version
|
|
FROM $base_image
|
|
# needed to do again after FROM due to docker limitation
|
|
ARG swift_version
|
|
ARG ubuntu_version
|
|
|
|
# set as UTF-8
|
|
RUN apt-get update && apt-get install -y locales locales-all
|
|
ENV LC_ALL en_US.UTF-8
|
|
ENV LANG en_US.UTF-8
|
|
ENV LANGUAGE en_US.UTF-8
|
|
|
|
# dependencies
|
|
RUN apt-get update && apt-get install -y wget
|
|
RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools curl jq # used by integration tests
|
|
|
|
# ruby and jazzy for docs generation, only on focal
|
|
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev build-essential
|
|
RUN if [ "${ubuntu_version}" = "focal" ] ; then echo "gem: --no-document" > ~/.gemrc; fi
|
|
RUN if [ "${ubuntu_version}" == "focal" ] ; then gem install jazzy; fi
|
|
|
|
# tools
|
|
RUN mkdir -p $HOME/.tools
|
|
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile
|
|
|
|
# swiftformat (until part of the toolchain)
|
|
|
|
ARG swiftformat_version=0.40.12
|
|
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/nicklockwood/SwiftFormat $HOME/.tools/swift-format
|
|
RUN cd $HOME/.tools/swift-format && swift build -c release
|
|
RUN ln -s $HOME/.tools/swift-format/.build/release/swiftformat $HOME/.tools/swiftformat
|