Skip to content

Instantly share code, notes, and snippets.

@crcrpar
Last active June 25, 2019 15:02
Show Gist options
  • Select an option

  • Save crcrpar/955d2743f64bfa9c033ff04d6ab59f9f to your computer and use it in GitHub Desktop.

Select an option

Save crcrpar/955d2743f64bfa9c033ff04d6ab59f9f to your computer and use it in GitHub Desktop.
Dockerfile for Swift 5.0.1 with Sourcekit
FROM swift:5.0.1-xenial
# Install git, process tools
RUN rm -rf /var/lib/apt/lists/* \
&& apt-get update -y \
&& apt-get -y --no-install-recommends install \
git \
procps \
aria2 \
libsqlite3-dev \
libncurses-dev
WORKDIR /opt
ENV SOURCEKIT_TOOLCHAIN_PATH=/opt/toolchain
ADD https://swift.org/builds/swift-5.0-branch/ubuntu1604/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-24-a/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-24-a-ubuntu16.04.tar.gz /opt
RUN mv swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-24-a-ubuntu16.04 toolchain \
&& cd /opt \
&& git clone https://github.com/apple/sourcekit-lsp
RUN cd /opt/sourcekit-lsp \
&& swift package update \
&& swift build -Xcxx -I/opt/toolchain/usr/lib/swift -Xcxx -I/opt/toolchain/usr/lib/swift/Block
# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Set the default shell to bash instead of sh
ENV SHELL /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment