Sign inSign up

helje5/rpi-swift-dev

By helje5

•Updated over 8 years ago

Dockerized Swift for Raspberry Pi w/ dev tools - https://github.com/helje5/dockSwiftOnARM

Image
4

10K+

helje5/rpi-swift-dev repository overview

This extends the basic Docker image helje5/rpi-swift with pre-installed dev-tools like Emacs, vim and CLang. It is intended as a development environment, e.g. if you want to build Swift packages on the Raspberry Pi.

Note: Unofficial Swift build, may or may not work for you :-)

⁠Supported tags:
  • 3.1.0, 3.1.1, latest, 4.1.0, 4.1.2
⁠How to run

An easy way to get Docker running on a RaspberryPi is the Hypriot image, here is a quick howto⁠. If you want to remote-control the Raspi from your mac, there is a howto⁠ for that as well.

Once you got Docker running, lets create and build a simple package:

docker run --tty -i helje5/rpi-swift-dev bash

swift@a6b3a3070fc9:~$ mkdir testit && cd testit
swift@a6b3a3070fc9:~/testit$ swift package init --type executable
Creating executable package: testit
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/

swift@a6b3a3070fc9:~/testit$ swift build
Compile Swift Module 'testit' (1 sources)
Linking ./.build/debug/testit

swift@a6b3a3070fc9:~/testit$ .build/debug/testit
Hello, world!

swift@a6b3a3070fc9:~/testit$ file .build/debug/testit
.build/debug/testit: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=bd83e3ab5bb7a1e487b81f40d26ea617a8663cc6, not stripped

Note: Swift REPL does not work on ARM. Swift Package Manager etc. now do.

There is also a demo image which shows how to run Apache Modules written in Swift on a Raspi, checkout: Running Server Side Swift on RaspberryPi ⁠.

⁠More Info

Checkout https://github.com/helje5/dockSwiftOnARM⁠ for more information.

Tag summary

Content type

Image

Digest

Size

626.7 MB

Last updated

over 8 years ago

docker pull helje5/rpi-swift-dev