As I knew, one of the problems with the current swift-test-runner is its large docker image size (~1 GB). There have been some attempts to address this issue.
As a proof of concept, I tried to reduce the size and achieved about a 40% reduction to 630 MB by removing libs and binaries that don’t seem necessary for Exercism’s needs.
The idea is simple: take the original swift Dockerfile and edit it to keep number of docker layers small as possible.
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
&& rm \
/usr/lib/liblldb.so* \
/usr/lib/libsourcekitdInProc.so \
/usr/lib/libswiftDemangle.so \
/usr/lib/libSwiftSourceKitClientPlugin.so \
/usr/lib/libSwiftSourceKitPlugin.so \
/usr/bin/docc \
/usr/bin/lld \
/usr/bin/lldb \
/usr/bin/lldb-argdumper \
/usr/bin/lldb-dap \
/usr/bin/lldb-server \
/usr/bin/sourcekit-lsp \
/usr/bin/swift-format \
/usr/bin/swift-plugin-server \
/usr/bin/wasmkit \
&& rm -r \
/usr/lib/swift_static \
/usr/lib/swift/embedded \
Removing all of this still allowed me to build and test a single package, although I haven’t tested it across the full spectrum of exercises.
Could this be considered a significant improvement? Who would be interested in helping to create a repository for it like nim-docker-base ?
2 Likes
@Meatball I’m really sorry to bother you again, but I honestly don’t know who else I could ask for advice.
Sorry been quite busy, so havn’t had the time to look at the forum (so pinging me is often a good solution). But yes I think this could be relevant to have a docker-image-base. @iHiD , could you take a look at this.
IsaacG
October 7, 2025, 1:05pm
4
@ErikSchierboom may also be able to help
GitHub - exercism/swift-docker-base has been created. The Swift team has write permissions
3 Likes
Thanks a lot, will create a PR in a couple of days with suggested changes.
PR is created . Final size is ~413 MB
2 Likes
@ErikSchierboom , Could you please add the required secret keys and bots to the GitHub repository when you have a moment?
Thank you! Could you please also rerun failed deploy and sync labels CI jobs? They should be available to be triggered from web interface.
The sync labels script fails due to:
unable to load manifest: open .github/labels.yml: no such file or directory
I think the best way to fix this is to copy this file from another repo.
I’ve fixed the deploy workflow.
1 Like
This two PR’s need attention:
exercism:main ← Sencudra:add-labels
opened 02:26PM - 31 Oct 25 UTC
Added `labels.yml` file to fix "update labels" job
exercism:main ← Sencudra:update_tag
opened 07:20PM - 05 Nov 25 UTC
While using this docker base image on my arm mashine the warning appeared:
> … WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
This is because by default `deplot.yml` job builds docker image for `linux/amd64` platform. The side effect of this is performance downgrade when using `amd64` docker image as a base for `arm64` platform.
This PR changes the docker image to be built for multiple platforms, including `arm64`.
Please review and merge.