This is amazing! Are there any plans to support Alpine? I had some attempts to make it build on Alpine, but that seemed like a project big enough on its own. Is supporting Alpine even on the roadmap? This would greatly help in reducing sizes of Docker images for certain tasks.
This is great news for the language. Personally I'm looking forward to seeing how small a deployable Docker image can get with these new distros in play. Has anyone done a roundup of base image sizes, or base image sizes + Swift runtime dependencies?
git is not a dependency of Swift, so if it is not installed on the distro by default, it won't be included in the Swift images. As for zlib, I just checked both and they come with zlib pre-installed. Is there any specific issue you have observed with the images?
we will be focussing on the distros that @tomerd outlined in his post next, but if you are interested in adding Alpine Linux support, contributions to the docker files are always welcome.
It seems like the installation instructions on Linux have changed with the addition of these distributions. For Ubuntu 18.04, the instructions mention the following dependencies:
This used to be only clang and libicu-dev (and git for SwiftPM). Are these really all required for running Swift (not building it from source)? Or did you replace clang by its dependencies?
I'd like to narrow down this list, if possible, in the instructions I give to my students. Installing Swift is already pretty cumbersome. I'm hoping it will eventually just be apt install swift-lang.
Note that swift.org publishes two versions of docker file, one is the normal image (e.g. swift:5.2) which has all the dependencies required to build programs with Swift, the other is the "slim" image (e.g. swift:5.2-slim) which only has the dependencies required to run programs compiled for that platform. The slim images are much smaller.
Of course, there is work that can be done to bring Swift to smaller distros, and we would love to see the community help with that
A word of caution for folks who want to build these images using Podman. I discovered an issue with how Podman/Buildah is handling the use of ARG and ENV in the Dockerfile. I've opened an issue here.
The workaround is to add an additional ARG line before the ENV one:
If there are folks here that are interested and can help get formal deb packages, rpms, etc into the main repositories we would love to work with you to get that done