swiftlang / swift-docker

Docker Official Image packaging for Swift
https://swift.org
Apache License 2.0
1.36k stars 182 forks source link

add support for alpine-based images #231

Open zg opened 3 years ago

zg commented 3 years ago

Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. The slimness of Alpine Linux makes it an attractive base image for use in production environments, namely Kubernetes, where it incurs a smaller startup latency and reduces image size in a Docker registry.

stevapple commented 3 years ago

You’ll need to port Swift to musl before you can get an Alpine image. Of course, we welcome such effort very much.

Gustl22 commented 1 year ago

See: https://github.com/apple/swift/issues/47209

finagolfin commented 4 months ago

@al45tair, any plans for this, building on your Musl work?

al45tair commented 4 months ago

I think it's probably worth returning to this question after WWDC. Alpine wasn't the focus of what I was up to with Musl, and making it work is in principle possible, but in practice I think we'd need to make significant upstream changes to Musl itself (which would then need to filter down into Alpine). I don't want to rule it out, because I know people will be interested in Alpine support, and the work I've been doing will make it easier, but it's still not trivial.