Skip to content

Commit 6355962

Browse files
committed
Enhance Dockerfile to include dependency copying for improved runtime environment
1 parent 90bb0bb commit 6355962

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ RUN touch src/main.rs && \
4242
--target $(cat TARGET) \
4343
--config target.$(cat TARGET).linker='"'$(cat LINKER)'"' \
4444
--profile superoptimized && \
45-
mv target/$(cat TARGET)/superoptimized/sqlpage sqlpage.bin
45+
mv target/$(cat TARGET)/superoptimized/sqlpage sqlpage.bin && \
46+
mkdir -p deps && \
47+
ldd sqlpage.bin | awk '($3 ~ /^\//) {print $3} ($1 ~ /^\//) {print $1}' | sort -u | xargs -I '{}' cp --parents '{}' deps/
4648

4749
FROM busybox:glibc
4850
RUN addgroup --gid 1000 --system sqlpage && \
@@ -55,6 +57,7 @@ ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
5557
WORKDIR /var/www
5658
COPY --from=builder /usr/src/sqlpage/sqlpage.bin /usr/local/bin/sqlpage
5759
COPY --from=builder /usr/src/sqlpage/libgcc_s.so.1 /lib/libgcc_s.so.1
60+
COPY --from=builder /usr/src/sqlpage/deps/ /
5861
USER sqlpage
5962
COPY --from=builder --chown=sqlpage:sqlpage /usr/src/sqlpage/sqlpage/sqlpage.db sqlpage/sqlpage.db
6063
EXPOSE 8080

0 commit comments

Comments
 (0)