Skip to content

Commit eadd2af

Browse files
committed
fix Dockerfile: include additional libraries
1 parent caca20f commit eadd2af

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ RUN apt-get update && \
88
echo gcc > LINKER && \
99
apt-get install -y gcc libgcc-s1 cmake unixodbc-dev && \
1010
cp /lib/*/libgcc_s.so.1 .; \
11+
cp /lib/*/libodbc.so.2 .; \
12+
cp /lib/*/libltdl.so.7 .; \
1113
elif [ "$TARGETARCH" = "arm64" ]; then \
1214
echo aarch64-unknown-linux-gnu > TARGET && \
1315
echo aarch64-linux-gnu-gcc > LINKER && \
1416
dpkg --add-architecture arm64 && apt-get update && \
1517
apt-get install -y gcc-aarch64-linux-gnu libgcc-s1-arm64-cross unixodbc-dev:arm64 && \
1618
cp /usr/aarch64-linux-gnu/lib/libgcc_s.so.1 .; \
19+
cp /usr/aarch64-linux-gnu/lib/libodbc.so.2 .; \
20+
cp /usr/aarch64-linux-gnu/lib/libltdl.so.7 .; \
1721
elif [ "$TARGETARCH" = "arm" ]; then \
1822
echo armv7-unknown-linux-gnueabihf > TARGET && \
1923
echo arm-linux-gnueabihf-gcc > LINKER && \
@@ -22,6 +26,8 @@ RUN apt-get update && \
2226
cargo install --force --locked bindgen-cli && \
2327
echo "-I/usr/lib/gcc-cross/arm-linux-gnueabihf/12/include -I/usr/arm-linux-gnueabihf/include" > BINDGEN_EXTRA_CLANG_ARGS; \
2428
cp /usr/arm-linux-gnueabihf/lib/libgcc_s.so.1 .; \
29+
cp /usr/arm-linux-gnueabihf/lib/libodbc.so.2 .; \
30+
cp /usr/arm-linux-gnueabihf/lib/libltdl.so.7 .; \
2531
else \
2632
echo "Unsupported cross compilation target: $TARGETARCH"; \
2733
exit 1; \
@@ -44,9 +50,7 @@ RUN touch src/main.rs && \
4450
--target $(cat TARGET) \
4551
--config target.$(cat TARGET).linker='"'$(cat LINKER)'"' \
4652
--profile superoptimized && \
47-
mv target/$(cat TARGET)/superoptimized/sqlpage sqlpage.bin && \
48-
mkdir -p deps && \
49-
ldd sqlpage.bin | awk '($3 ~ /^\//) {print $3} ($1 ~ /^\//) {print $1}' | sort -u | xargs -I '{}' cp --parents '{}' deps/
53+
mv target/$(cat TARGET)/superoptimized/sqlpage sqlpage.bin
5054

5155
FROM busybox:glibc
5256
RUN addgroup --gid 1000 --system sqlpage && \
@@ -58,8 +62,7 @@ ENV SQLPAGE_WEB_ROOT=/var/www
5862
ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
5963
WORKDIR /var/www
6064
COPY --from=builder /usr/src/sqlpage/sqlpage.bin /usr/local/bin/sqlpage
61-
COPY --from=builder /usr/src/sqlpage/libgcc_s.so.1 /lib/libgcc_s.so.1
62-
COPY --from=builder /usr/src/sqlpage/deps/ /
65+
COPY --from=builder /usr/src/sqlpage/*.so.* /lib/
6366
USER sqlpage
6467
COPY --from=builder --chown=sqlpage:sqlpage /usr/src/sqlpage/sqlpage/sqlpage.db sqlpage/sqlpage.db
6568
EXPOSE 8080

0 commit comments

Comments
 (0)