I did a PR, but ugh, those are many Dockerfiles ...
<3
yea seems like there is an opportunity there to reduce them / generate them
P.S.: I think I did properly report the issue years ago. I'm a little surprised this isn't in yet, is anyone actually using those images? :-)
I think most usage of these images is to build applications using the toolchain, not to run applications. for deployment, folks often copy the entire .build/release output directory into a plain linux docker (i.e. without the toolchain) and that directory should have everything you need to run the application
So something like libFoundation.so is magically appearing how? ;-) In the Docker examples you include the slim Swift image probably for that reason (vs just a plain Ubuntu). Though I'm not positive how that could have ever worked
FROM swift:latest as builder
WORKDIR /root
COPY . .
RUN swift build -c release
FROM swift:slim
WORKDIR /root
COPY --from=builder /root .
CMD [".build/x86_64-unknown-linux/release/docker-test"]
oh yea, of course... forgot we also copy /usr/lib/swift/linux/lib*so* :D but the high level point remains that folks dont normally deploy into a docker image that carries the toolchain but to a vanilla docker images (plain ubuntu, centos, etc)
in the lambda examples we do ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Lv -t "$target" which uses ldd to figure out the exact dependencies... ldd is not perfect but its an interesting technique
So the reason it works is that you copy the runtime libs from their subdirectories into a preconfigured LD_LIB_PATH, like say /usr/local/lib. That makes sense.
But the Docker sample from the repo should still fail? Or maybe it doesn't because it isn't using Foundation? No idea