From d0f034972f63f731abbda5bbdc9208058e7c6acd Mon Sep 17 00:00:00 2001 From: Will Lisac Date: Mon, 24 Jun 2019 23:00:25 -0700 Subject: [PATCH 1/2] Add Swift 5.0.1 Dockerfiles for ARMv6 and ARMv7 --- .../armv7hf/debian/stretch/5.0.1/Dockerfile | 58 ++++++++++++++++++ .../armv7hf/ubuntu/bionic/5.0.1/Dockerfile | 54 +++++++++++++++++ .../armv7hf/ubuntu/xenial/5.0.1/Dockerfile | 54 +++++++++++++++++ .../rpi/debian/stretch/5.0.1/Dockerfile | 54 +++++++++++++++++ .../debian/stretch/5.0.1/Dockerfile | 60 +++++++++++++++++++ .../ubuntu/bionic/5.0.1/Dockerfile | 56 +++++++++++++++++ .../ubuntu/xenial/5.0.1/Dockerfile | 56 +++++++++++++++++ .../debian/stretch/5.0.1/Dockerfile | 56 +++++++++++++++++ .../debian/stretch/5.0.1/Dockerfile | 60 +++++++++++++++++++ .../ubuntu/bionic/5.0.1/Dockerfile | 56 +++++++++++++++++ .../ubuntu/xenial/5.0.1/Dockerfile | 56 +++++++++++++++++ .../debian/stretch/5.0.1/Dockerfile | 60 +++++++++++++++++++ .../ubuntu/bionic/5.0.1/Dockerfile | 56 +++++++++++++++++ .../ubuntu/xenial/5.0.1/Dockerfile | 56 +++++++++++++++++ 14 files changed, 792 insertions(+) create mode 100644 Dockerfiles/architecture-base/armv7hf/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/architecture-base/armv7hf/ubuntu/bionic/5.0.1/Dockerfile create mode 100644 Dockerfiles/architecture-base/armv7hf/ubuntu/xenial/5.0.1/Dockerfile create mode 100644 Dockerfiles/architecture-base/rpi/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/generic-armv7ahf/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/generic-armv7ahf/ubuntu/bionic/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/generic-armv7ahf/ubuntu/xenial/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberry-pi/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberry-pi2/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberry-pi2/ubuntu/bionic/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberry-pi2/ubuntu/xenial/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberrypi3/debian/stretch/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberrypi3/ubuntu/bionic/5.0.1/Dockerfile create mode 100644 Dockerfiles/device-base/raspberrypi3/ubuntu/xenial/5.0.1/Dockerfile diff --git a/Dockerfiles/architecture-base/armv7hf/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/architecture-base/armv7hf/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..5093f10 --- /dev/null +++ b/Dockerfiles/architecture-base/armv7hf/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,58 @@ +# wlisac/armv7hf-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/armv7hf-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Started with dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +# Also, I was getting "Unable to locate package libgcc-5-dev" and "Unable to locate package libstdc++-5-dev" +# from the raw armv7hf base image. +# I just removed these explicit dependencies since clang includes newer versions anyway. +# https://forums.swift.org/t/which-clang-package-should-we-install/20542/7 +# Upgrading to libgcc-6-dev and libstdc++-6-dev explicitly would also be fine. + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/architecture-base/armv7hf/ubuntu/bionic/5.0.1/Dockerfile b/Dockerfiles/architecture-base/armv7hf/ubuntu/bionic/5.0.1/Dockerfile new file mode 100644 index 0000000..4475b52 --- /dev/null +++ b/Dockerfiles/architecture-base/armv7hf/ubuntu/bionic/5.0.1/Dockerfile @@ -0,0 +1,54 @@ +# wlisac/armv7hf-ubuntu-swift:5.0.1-bionic + +ARG BASE_IMAGE=balenalib/armv7hf-ubuntu:bionic + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:bionic as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1804.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 18.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/18.04/Dockerfile + +# Needed to add clang +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl4 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/architecture-base/armv7hf/ubuntu/xenial/5.0.1/Dockerfile b/Dockerfiles/architecture-base/armv7hf/ubuntu/xenial/5.0.1/Dockerfile new file mode 100644 index 0000000..9a71cb3 --- /dev/null +++ b/Dockerfiles/architecture-base/armv7hf/ubuntu/xenial/5.0.1/Dockerfile @@ -0,0 +1,54 @@ +# wlisac/armv7hf-ubuntu-swift:5.0.1-xenial + +ARG BASE_IMAGE=balenalib/armv7hf-ubuntu:xenial + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:xenial as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1604.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/architecture-base/rpi/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/architecture-base/rpi/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..fb9cdf2 --- /dev/null +++ b/Dockerfiles/architecture-base/rpi/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,54 @@ +# wlisac/rpi-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/rpi-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/rpi-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/generic-armv7ahf/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/device-base/generic-armv7ahf/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..2384a44 --- /dev/null +++ b/Dockerfiles/device-base/generic-armv7ahf/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,60 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-debian-swift:5.0.1-stretch + +# wlisac/generic-armv7ahf-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/generic-armv7ahf-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Started with dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +# Also, I was getting "Unable to locate package libgcc-5-dev" and "Unable to locate package libstdc++-5-dev" +# from the raw armv7hf base image. +# I just removed these explicit dependencies since clang includes newer versions anyway. +# https://forums.swift.org/t/which-clang-package-should-we-install/20542/7 +# Upgrading to libgcc-6-dev and libstdc++-6-dev explicitly would also be fine. + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/generic-armv7ahf/ubuntu/bionic/5.0.1/Dockerfile b/Dockerfiles/device-base/generic-armv7ahf/ubuntu/bionic/5.0.1/Dockerfile new file mode 100644 index 0000000..f1938af --- /dev/null +++ b/Dockerfiles/device-base/generic-armv7ahf/ubuntu/bionic/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-bionic + +# wlisac/generic-armv7ahf-ubuntu-swift:5.0.1-bionic + +ARG BASE_IMAGE=balenalib/generic-armv7ahf-ubuntu:bionic + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:bionic as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1804.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 18.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/18.04/Dockerfile + +# Needed to add clang +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl4 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/generic-armv7ahf/ubuntu/xenial/5.0.1/Dockerfile b/Dockerfiles/device-base/generic-armv7ahf/ubuntu/xenial/5.0.1/Dockerfile new file mode 100644 index 0000000..087e659 --- /dev/null +++ b/Dockerfiles/device-base/generic-armv7ahf/ubuntu/xenial/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-xenial + +# wlisac/generic-armv7ahf-ubuntu-swift:5.0.1-xenial + +ARG BASE_IMAGE=balenalib/generic-armv7ahf-ubuntu:xenial + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:xenial as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1604.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberry-pi/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberry-pi/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..ad2c7fc --- /dev/null +++ b/Dockerfiles/device-base/raspberry-pi/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/rpi-debian-swift:5.0.1-stretch + +# wlisac/raspberry-pi-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/raspberry-pi-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/rpi-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberry-pi2/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberry-pi2/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..dfe57bf --- /dev/null +++ b/Dockerfiles/device-base/raspberry-pi2/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,60 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-debian-swift:5.0.1-stretch + +# wlisac/raspberry-pi2-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/raspberry-pi2-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Started with dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +# Also, I was getting "Unable to locate package libgcc-5-dev" and "Unable to locate package libstdc++-5-dev" +# from the raw armv7hf base image. +# I just removed these explicit dependencies since clang includes newer versions anyway. +# https://forums.swift.org/t/which-clang-package-should-we-install/20542/7 +# Upgrading to libgcc-6-dev and libstdc++-6-dev explicitly would also be fine. + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberry-pi2/ubuntu/bionic/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberry-pi2/ubuntu/bionic/5.0.1/Dockerfile new file mode 100644 index 0000000..66ed810 --- /dev/null +++ b/Dockerfiles/device-base/raspberry-pi2/ubuntu/bionic/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-bionic + +# wlisac/raspberry-pi2-ubuntu-swift:5.0.1-bionic + +ARG BASE_IMAGE=balenalib/raspberry-pi2-ubuntu:bionic + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:bionic as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1804.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 18.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/18.04/Dockerfile + +# Needed to add clang +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl4 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberry-pi2/ubuntu/xenial/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberry-pi2/ubuntu/xenial/5.0.1/Dockerfile new file mode 100644 index 0000000..cdfc5a4 --- /dev/null +++ b/Dockerfiles/device-base/raspberry-pi2/ubuntu/xenial/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-xenial + +# wlisac/raspberry-pi2-ubuntu-swift:5.0.1-xenial + +ARG BASE_IMAGE=balenalib/raspberry-pi2-ubuntu:xenial + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:xenial as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1604.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberrypi3/debian/stretch/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberrypi3/debian/stretch/5.0.1/Dockerfile new file mode 100644 index 0000000..8df5757 --- /dev/null +++ b/Dockerfiles/device-base/raspberrypi3/debian/stretch/5.0.1/Dockerfile @@ -0,0 +1,60 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-debian-swift:5.0.1-stretch + +# wlisac/raspberrypi3-debian-swift:5.0.1-stretch + +ARG BASE_IMAGE=balenalib/raspberrypi3-debian:stretch + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-debian:stretch as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi0123-RaspbianStretch.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Started with dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +# Also, I was getting "Unable to locate package libgcc-5-dev" and "Unable to locate package libstdc++-5-dev" +# from the raw armv7hf base image. +# I just removed these explicit dependencies since clang includes newer versions anyway. +# https://forums.swift.org/t/which-clang-package-should-we-install/20542/7 +# Upgrading to libgcc-6-dev and libstdc++-6-dev explicitly would also be fine. + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberrypi3/ubuntu/bionic/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberrypi3/ubuntu/bionic/5.0.1/Dockerfile new file mode 100644 index 0000000..5baa4c4 --- /dev/null +++ b/Dockerfiles/device-base/raspberrypi3/ubuntu/bionic/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-bionic + +# wlisac/raspberrypi3-ubuntu-swift:5.0.1-bionic + +ARG BASE_IMAGE=balenalib/raspberrypi3-ubuntu:bionic + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:bionic as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1804.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 18.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/18.04/Dockerfile + +# Needed to add clang +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl4 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version diff --git a/Dockerfiles/device-base/raspberrypi3/ubuntu/xenial/5.0.1/Dockerfile b/Dockerfiles/device-base/raspberrypi3/ubuntu/xenial/5.0.1/Dockerfile new file mode 100644 index 0000000..2367e33 --- /dev/null +++ b/Dockerfiles/device-base/raspberrypi3/ubuntu/xenial/5.0.1/Dockerfile @@ -0,0 +1,56 @@ +# Autogenerated device Dockerfile based on architecture Dockerfile: wlisac/armv7hf-ubuntu-swift:5.0.1-xenial + +# wlisac/raspberrypi3-ubuntu-swift:5.0.1-xenial + +ARG BASE_IMAGE=balenalib/raspberrypi3-ubuntu:xenial + +# Download and decompress the tarball into an intermediate container +# to improve cache accross different base image variations + +FROM balenalib/armv7hf-ubuntu:xenial as downloader + +LABEL Description="Swift Downloader" + +ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.0.1/swift-5.0.1-RPi23-Ubuntu1604.tgz +ARG TARBALL_FILE=swift.tgz + +WORKDIR /swift + +RUN curl -L -o $TARBALL_FILE $TARBALL_URL \ + && tar -xvzf $TARBALL_FILE -C /swift \ + && rm $TARBALL_FILE + +# Create base image + +FROM "$BASE_IMAGE" + +LABEL maintainer "Will Lisac " +LABEL Description="Docker Container for Swift on Balena" + +# Dependencies from official Swift Dockerfile for Swift 5.0 on Ubuntu 16.04 +# https://github.com/apple/swift-docker/blob/6812f217b405a5101ea3e8fce4d1cf09e3c8727b/5.0/ubuntu/16.04/Dockerfile + +# Needed to add clang (not clang-3.8) +# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies + +RUN install_packages \ + libatomic1 \ + libbsd0 \ + libcurl3 \ + libxml2 \ + libedit2 \ + libsqlite3-0 \ + libc6-dev \ + binutils \ + libgcc-5-dev \ + libstdc++-5-dev \ + libpython2.7 \ + tzdata \ + git \ + pkg-config \ + clang + +# Copy files from downloader to root +COPY --from=downloader /swift / + +RUN swift --version From b67f47ba4b06c3d113d2c53492089b4900ddad31 Mon Sep 17 00:00:00 2001 From: Will Lisac Date: Fri, 28 Jun 2019 18:34:42 -0700 Subject: [PATCH 2/2] Update README for Swift 5.0.1 --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7efa510..5348a0d 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,12 @@ Use this [sample project](https://github.com/wlisac/balena-swift-hello-world) to | Device | Architecture | Swift | Docker Image | | ----------------------- | ------------ | ----- | ------------------------------------------------ | -| Raspberry Pi (v1 or Zero) | armv6 | 5.0 | [`wlisac/raspberry-pi-swift:5.0`](https://hub.docker.com/r/wlisac/raspberry-pi-swift/tags) | -| Raspberry Pi 2 | armv7hf | 5.0 | [`wlisac/raspberry-pi2-swift:5.0`](https://hub.docker.com/r/wlisac/raspberry-pi2-swift/tags) | -| Raspberry Pi 3 | armv7hf | 5.0 | [`wlisac/raspberrypi3-swift:5.0`](https://hub.docker.com/r/wlisac/raspberrypi3-swift/tags) | -| Raspberry Pi 3 (using 64 bit OS) | aarch64 | 5.0 | [`wlisac/raspberrypi3-64-swift:5.0`](https://hub.docker.com/r/wlisac/raspberrypi3-64-swift/tags) | -| Generic ARMv7-a HF | armv7hf | 5.0 | [`wlisac/generic-armv7ahf-swift:5.0`](https://hub.docker.com/r/wlisac/generic-armv7ahf-swift/tags) | -| Generic AARCH64 (ARMv8) | aarch64 | 5.0 | [`wlisac/generic-aarch64-swift:5.0`](https://hub.docker.com/r/wlisac/generic-aarch64-swift/tags) | +| Raspberry Pi (v1 or Zero) | armv6 | 5.0.1 | [`wlisac/raspberry-pi-swift:5.0.1`](https://hub.docker.com/r/wlisac/raspberry-pi-swift/tags) | +| Raspberry Pi 2 | armv7hf | 5.0.1 | [`wlisac/raspberry-pi2-swift:5.0.1`](https://hub.docker.com/r/wlisac/raspberry-pi2-swift/tags) | +| Raspberry Pi 3 | armv7hf | 5.0.1 | [`wlisac/raspberrypi3-swift:5.0.1`](https://hub.docker.com/r/wlisac/raspberrypi3-swift/tags) | +| Raspberry Pi 3 (using 64 bit OS) | aarch64 | 5.0.1 | [`wlisac/raspberrypi3-64-swift:5.0.1`](https://hub.docker.com/r/wlisac/raspberrypi3-64-swift/tags) | +| Generic ARMv7-a HF | armv7hf | 5.0.1 | [`wlisac/generic-armv7ahf-swift:5.0.1`](https://hub.docker.com/r/wlisac/generic-armv7ahf-swift/tags) | +| Generic AARCH64 (ARMv8) | aarch64 | 5.0.1 | [`wlisac/generic-aarch64-swift:5.0.1`](https://hub.docker.com/r/wlisac/generic-aarch64-swift/tags) | ## Image Variants @@ -44,8 +44,8 @@ There are several image variants available depending on hardware, Linux distribu - Debian: Stretch - Ubuntu: Bionic and Xenial - Swift Versions - - Swift 4 - - Swift 5 + - Swift 4 (`4.2.3`) + - Swift 5 (`5.0.1`, `5.0`) ### Image Naming Scheme