Created
December 20, 2015 20:28
-
-
Save marius-serban/038249e4959baaadb532 to your computer and use it in GitHub Desktop.
Swift on Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker build -t swift ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:15.10 | |
# Latest Swift Version | |
ENV SWIFT_VERSION 2.2-SNAPSHOT-2015-12-01-b | |
ENV SWIFT_PLATFORM ubuntu15.10 | |
# Install Dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
clang \ | |
libicu55 \ | |
libpython2.7 \ | |
wget && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Install Swift keys | |
RUN wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import - && \ | |
gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift | |
# Download and install Swift | |
RUN SWIFT_ARCHIVE_NAME=swift-$SWIFT_VERSION-$SWIFT_PLATFORM && \ | |
SWIFT_URL=https://swift.org/builds/$(echo "$SWIFT_PLATFORM" | tr -d .)/swift-$SWIFT_VERSION/$SWIFT_ARCHIVE_NAME.tar.gz && \ | |
wget $SWIFT_URL && \ | |
wget $SWIFT_URL.sig && \ | |
gpg --verify $SWIFT_ARCHIVE_NAME.tar.gz.sig && \ | |
tar -xvzf $SWIFT_ARCHIVE_NAME.tar.gz -C / --strip 1 && \ | |
rm -rf $SWIFT_ARCHIVE_NAME* /tmp/* /var/tmp/* | |
#Building a webserver? Expose Port 80 by uncommenting the following. | |
#Expose 80 | |
#Copy our sample swift program into the Docker image | |
COPY fibonacci.swift /tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker run -it swift /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment