# FROM ubuntu
FROM debian:jessie
ARG APT_MIRROR='opensource.nchc.org.tw'
RUN sed --in-place "s/httpredir.debian.org/$APT_MIRROR/g" /etc/apt/sources.list \
&& sed --in-place "s/deb.debian.org/$APT_MIRROR/g" /etc/apt/sources.list
RUN echo "deb http://$APT_MIRROR/debian jessie-backports main" >> /etc/apt/sources.list \
&& apt-get -y update \
&& apt-get install -y -t jessie-backports cmake \
&& sed -i '/jessie-backports/d' /etc/apt/sources.list \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get -y update \
&& apt-get -y install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev tzdata \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& mkdir swift-source \
&& cd swift-source \
&& git clone
https://github.com/apple/swift.git \
&& ./swift/utils/update-checkout --clone \
&& cd swift \
&& utils/build-script --release-debuginfo