Docker images for Swift on Raspberry Pi and other ARM devices from balena's base images.

Overview

Swift on Balena

Welcome to Swift on Balena – a set of Docker images for Swift on Raspberry Pi and other ARM devices. These images are based on balena's IoT focused Docker images and make it easy to build and run Swift apps on ARM.

Getting Started

Use this sample project to get started with Swift and Docker on your Raspberry Pi.

Latest Releases

Device Based Images

Device based images are a great way to get started with Swift on a specific device type.

Device Architecture Swift Docker Image
Raspberry Pi (v1 or Zero) armv6 5.1 wlisac/raspberry-pi-swift:5.1-build
Raspberry Pi Zero 2 W
(64-bit OS)
aarch64 5.5.1 wlisac/raspberrypi0-2w-64-swift:5.5.1-build
Raspberry Pi 2 armv7hf 5.1 wlisac/raspberry-pi2-swift:5.1-build
Raspberry Pi 3 armv7hf 5.1 wlisac/raspberrypi3-swift:5.1-build
Raspberry Pi 3 (64-bit OS) aarch64 5.5.1 wlisac/raspberrypi3-64-swift:5.5.1-build
Raspberry Pi 4 (64-bit OS) aarch64 5.5.1 wlisac/raspberrypi4-64-swift:5.5.1-build
Generic ARMv7-a HF armv7hf 5.1 wlisac/generic-armv7ahf-swift:5.1-build
Generic AARCH64 (ARMv8) aarch64 5.5.1 wlisac/generic-aarch64-swift:5.5.1-build

Architecture Based Images

Architecture based images are useful when building an image for multiple device types with a common architecture.

Device Architecture Swift Docker Image
Raspberry Pi (v1 or Zero) armv6 5.1 wlisac/rpi-swift:5.1-build
Raspberry Pi 2
Raspberry Pi 3
Generic ARMv7-a HF
armv7hf 5.1 wlisac/armv7hf-swift:5.1-build
Raspberry Pi Zero 2 W (64-bit OS)
Raspberry Pi 3 (64-bit OS)
Raspberry Pi 4 (64-bit OS)
Generic AARCH64 (ARMv8)
aarch64 5.5.1 wlisac/aarch64-swift:5.5.1-build

Image Variants

There are several image variants available depending on hardware, Linux distribution, and Swift version.

  • Devices
    • Raspberry Pi (v1 or Zero)
    • Raspberry Pi Zero 2 W (64-bit OS)
    • Raspberry Pi 2
    • Raspberry Pi 3
    • Raspberry Pi 3 (64-bit OS)
    • Raspberry Pi 4 (64-bit OS)
    • Generic ARMv7-a HF
    • Generic AARCH64 (ARMv8)
  • Linux Distributions
    • Debian: Stretch
    • Ubuntu: Bionic and Xenial
  • Swift Versions
    • Swift 4 (4.2.3)
    • Swift 5 (5.5.1, 5.1, 5.0.1, 5.0)
  • build and run image variants for multi-stage builds

Image Naming Scheme

The image naming scheme for Swift on Balena supports a subset of balena's image naming scheme and follows the pattern below.

wlisac/<hardware>-<distro>-swift:<swift_version>-<distro_version>-(build|run)

Image Names

  • <hardware> is either the device type or architecture and is required. See the device list for available device names and architecture names.
  • <distro> is the Linux distribution. This is optional and will usually default to Debian, but may fall-back to Ubuntu if a Debian variant is not available.

Image Tags

  • <swift_version> is the version of Swift and is required.
  • <distro_version> is the version of the Linux distribution and is required if a distribution is specified in the image name.
  • (build|run) specifies either the build or run image variant and is required. The build variant includes the Swift compiler, Swift Package Manager, and other tools needed to build and run a Swift app from source. The run variant is much lighter-weight, does not include the Swift compiler, and is designed to run an already built Swift app. The build and run image variants can be used together in a multi-stage Dockerfile to produce a smaller image that's ready for deployment.

Examples

wlisac/raspberrypi3-swift:5.1-build

  • <hardware>: raspberrypi3 – the Raspberry Pi 3 device type
  • <distro>: omitted – defaulted to Debian
  • <swift_version>: 5.1 – specifies Swift version 5.1
  • <distro_version>: omitted – defaulted to Stretch
  • (build|run): build – specifies the build variant for building a Swift app from source

wlisac/raspberrypi3-ubuntu-swift:4.2.3-bionic-run

  • <hardware>: raspberrypi3 – the Raspberry Pi 3 device type
  • <distro>: ubuntu
  • <swift_version>: 4.2.3 – specifies Swift version 4.2.3
  • <distro_version>: bionic – Ubuntu 18.04
  • (build|run): run – specifies the run variant for running an already built Swift app

wlisac/armv7hf-swift:5.1-build

  • <hardware>: armv7hf – the armv7hf architecture type
  • <distro>: omitted – defaulted to Debian
  • <swift_version>: 5.1 – specifies Swift version 5.1
  • <distro_version>: omitted – defaulted to Stretch
  • (build|run): build – specifies the build variant for building a Swift app from source

Acknowledgments

Swift on Balena is possible because of the amazing work done by the Swift on ARM community and the projects below.

Join the community in the swift-arm Slack channel.

Comments
  • list supported versions

    list supported versions

    It would be nice if you could list supported versions of Swift someplace. I was able to glean that the 4.2.x that you support is 4.2.3 by going here but it was non-obvious.

    I just wasn't up on what point release Swift 4.2 was at, is all.

    opened by incanus 2
  • Add support for `build` and `run` image variants

    Add support for `build` and `run` image variants

    This adds support for build and run image variants. It also deprecates images that do not include build or run in the tag (more on this below).

    For example:

    • Adds wlisac/raspberrypi3-swift:5.0.1-build
    • Adds wlisac/raspberrypi3-swift:5.0.1-run
    • Deprecates: wlisac/raspberrypi3-swift:5.0.1

    The build variant includes the Swift compiler, Swift Package Manager, and other tools needed to build and run a Swift app from source.

    The run variant is much lighter-weight, does not include the Swift compiler, and is designed to run an already built Swift app.

    The build and run image variants can be used together in a multi-stage Dockerfile to produce a smaller image that's ready for deployment.

    For example, from the balena-swift-hello-world sample project:

    # Dockerfile for Raspberry Pi 3
    
    # The build container for building the Swift app from source
    FROM wlisac/raspberrypi3-swift:5.0.1-build AS build
    
    WORKDIR /app
    
    COPY . ./
    
    RUN swift build --jobs 1
    
    # The run container that will go to devices
    FROM wlisac/raspberrypi3-swift:5.0.1-run
    
    WORKDIR /app
    
    COPY --from=build /app/.build/debug/Hello .
    
    CMD ["./Hello"]
    

    Using a multi-stage build with the build and run image variants can significantly reduce the size of the final deployment image. On average, the build images are ~1.3GB and the run images are ~250MB.

    This change is inspired by the recent work on the swift-docker repo to add official slim Swift images: https://github.com/apple/swift-docker/pull/140

    This also gets this project closer aligned with official balena base images that include build and run variants: https://www.balena.io/docs/reference/base-images/base-images/#run-vs-build

    The previous images in this repo without build or run in the tag are deprecated as part of a longer term plan to closer align with balena's official base images. The images without build or run in the tag were more like build images, but balena's images default to run images when build or run is not specified.

    opened by wlisac 1
  • Add Swift 5.5.1 Dockerfiles for aarch64 devices

    Add Swift 5.5.1 Dockerfiles for aarch64 devices

    This adds Swift 5.5.1 Dockerfiles for aarch64 devices 🎉

    Note: armv6 and armv7 builds are not yet available from uraimo/buildSwiftOnARM. Images for armv6 and armv7 will remain on Swift 5.1 for now.

    opened by wlisac 0
  • Add Swift 5.1 Dockerfiles for armv6, armv7, and aarch64 devices

    Add Swift 5.1 Dockerfiles for armv6, armv7, and aarch64 devices

    opened by wlisac 0
  • Update Swift 5.0.1 images for aarch64 to support `--jobs` flag

    Update Swift 5.0.1 images for aarch64 to support `--jobs` flag

    This updates the aarch64 Swift 5.0.1 images to use a patched Swift binary that was released today by @futurejones: https://github.com/futurejones/swift-arm64/releases/tag/v5.0.1-RELEASE

    This "patched" version includes the -j / --jobs build option to limit the number of threads used by the Swift Package Manager. See more details about this option at https://github.com/apple/swift-package-manager/pull/2127.

    Using this option is recommended when building on Raspberry Pi hardware:

    swift build --jobs 1
    

    The armv7 and armv6 based images for Swift 5.0.1 already included this patch: https://github.com/uraimo/buildSwiftOnARM/releases/tag/5.0.1

    opened by wlisac 0
  • Make device-based build images start from balena build images

    Make device-based build images start from balena build images

    This fixes a mistake where only architecture-based build image variants were starting from balena's build image variant. The device-based images were starting from the default run variant. Now all build variants correctly start from the balena build variant.

    This also unifies how the base image is specified for both run and build variants and updates the CLI automation to handle these changes.

    opened by wlisac 0
  • Add Swift 5.0.1 for aarch64 and document the build process

    Add Swift 5.0.1 for aarch64 and document the build process

    Uses aarch64 5.0.1 release from futurejones: https://github.com/futurejones/swift-arm64/releases/tag/v5.0.1-RELEASE

    32 bit 5.0.1 binaries are not currently available from uraimo, so keeping 5.0 as the latest release on the readme to avoid an inconsistency between 32/64 bit.

    Images pushed to Docker Hub

    Device default images: wlisac/generic-aarch64-swift:5.0.1 wlisac/raspberrypi3-64-swift:5.0.1

    Device images with OS variants: wlisac/generic-aarch64-ubuntu-swift:5.0.1-bionic wlisac/generic-aarch64-ubuntu-swift:5.0.1-xenial

    wlisac/raspberrypi3-64-ubuntu-swift:5.0.1-bionic wlisac/raspberrypi3-64-ubuntu-swift:5.0.1-xenial

    Architecture base images: wlisac/aarch64-ubuntu-swift:5.0.1-bionic wlisac/aarch64-ubuntu-swift:5.0.1-xenial

    opened by wlisac 0
  • 5.2 images and 5.3 nightlies

    5.2 images and 5.3 nightlies

    I don't know how hard would it be to provide 5.2 images, and definitely I wouldn't expect 5.3 nightlies to be uploaded regularly, but at least it would make sense to maintain a Dockerfile for 5.3 if possible, similarly to what upstream does here.

    opened by MaxDesiatov 4
Releases(5.5.1-aarch64)
Owner
Will Lisac
Swift and iOS
Will Lisac
Demo project to sync color changes to an Raspberry Pi Mood Light via iOS/Android

Raspberry Pi Mood Light Demo project to remotely control an Raspberry Pi Mood Light over Bluetooth via iOS and Android. ?? Watch the video Overview In

Ditto 10 Oct 17, 2022
A Swift library for hardware projects on Linux/ARM boards with support for GPIOs/SPI/I2C/PWM/UART/1Wire.

A Swift library for hardware projects on Linux/ARM boards with support for GPIOs/SPI/I2C/PWM/UART/1Wire. Summary This library provides an easy way to

uraimo 1.3k Dec 26, 2022
A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.

macOS Virtual Machine A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework. I copied KhaosT's code from here, all I did is chang

Ming Chang 127 Nov 30, 2022
PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

Alexandr 4k Jul 8, 2022
A Swift package that provides convenient Lorem Ipsum text, images, colors and other placeholders for rapidly prototyping, building and testing your iOS applications.

Lorem Introducing Lorem, a placeholder generator library for iOS to help you rapidly prototype, build and test your iOS applications. By leveraging Sw

Thirdfort Limited 10 Dec 5, 2022
Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

Dale Zak 109 Dec 11, 2022
Static Native Template and Dynamic Styling without any other app release

FileManager Project Students and Freshers, Good opportunity for you to learn and contribute in this project. Here you would learn how you can change t

Naveen Chauhan 3 Nov 30, 2021
Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

James Knipe 0 Dec 28, 2021
Challenging each other to complete pet projects!

Podlodka Pet Project Challenge Мотивируем друг друга на завершение своих пет проджектов! Каждую неделю каждый участник вносит в банк 1 ставку и ведет

Vladimir Korolev 2 Aug 27, 2022
A custom calculator for deg to rad conversion & the other way round

Lilium Features A custom calculator for deg to rad conversion & the other way round. How to use Slide up the dock and you should see Lilium. An activa

null 2 Nov 20, 2022
React Native package for interacting with HomeKit devices

React Native package for interacting with HomeKit devices

Ibrahim Berat Kaya 4 Dec 24, 2021
Open-source jailbreaking tool for many iOS devices

Open-source jailbreaking tool for many iOS devices *Read disclaimer before using this software. checkm8 permanent unpatchable bootrom exploit for hund

null 0 Nov 6, 2021
Multitasking Drawer tweak for jailbroken iOS devices

PullOver-Pro Multitasking Drawer tweak for jailbroken iOS devices About PullOver Pro is multitasking substrate / jailbreak / runtime extension written

c1d3r 25 Oct 10, 2022
Ported scrcpy for mobile platforms, to remotely control Android devices on your iPhone or Android phone.

scrcpy-mobile Ported scrcpy for mobile platforms, to remotely control Android devices on your iPhone or Android phone. Currently only supports control

Ethan 140 Jan 2, 2023
Flutter package for detecting NSFW images and videos using native implementation

Flutter NSFW 1- Download, tflite modle and put it in assets folder 2 - Add the path of the tfliet to pubspec.yaml 3 - Read the file using path_provide

Syed Ahsan Ali 8 Oct 16, 2022
Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Peter Larson 17 Jun 27, 2022
SharedImages Screen grabs Main Features Private & self-owned social media Users store their images in their own cloud storage (Dropbox or Google Drive

SharedImages Screen grabs Main Features Private & self-owned social media Users store their images in their own cloud storage (Dropbox or Google Drive

Christopher Prince 12 Feb 10, 2022
An example implementation of using a native iOS Notification Service Extension (to display images in remote push notification) in Titanium.

Titanium iOS Notification Service Extension An example implementation of using a native iOS Notification Service Extension (to display images in remot

Hans Knöchel 8 Nov 21, 2022
React Native utility library around image and video files for getting metadata like MIME type, timestamp, duration, and dimensions. Works on iOS and Android using Java and Obj-C, instead of Node 🚀.

Qeepsake React Native File Utils Extracts information from image and video files including MIME type, duration (video), dimensions, and timestamp. The

Qeepsake 12 Oct 19, 2022