Я создаю серверное приложение, написанное на Swift, и впервые пытаюсь развернуть его в Linux. Обычно я следую этому руководству и некоторым другим, найденным в Интернете.
Моя команда докера:
Код: Выделить всё
docker run --rm -v "$PWD:/code" -w /code --platform linux/amd64 \
-e QEMU_CPU=max swift:latest
The shared libs are copied from the container, so they are the ones the binary was compiled against. Also, without them on my linux server my binary crashes with a missing .so message, so they are in the right place.
Код: Выделить всё
file mybinary
Код: Выделить всё
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
I also tried to build the app with
Код: Выделить всё
--static-swift-stdlibs
I know that I should probably run it in a container on the server too, but I was trying to avoid that to minimize overhead.
What am I doing wrong? Is this even possible to do at all, i.e. run this binary without a container on the server?
Источник: https://stackoverflow.com/questions/781 ... real-linux