Skip to content

Commit e24a49f

Browse files
authored
chore(Dockerfile): ensure backtraces are available
1 parent 90f1462 commit e24a49f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ RUN mkdir -p /app/bin
4444

4545
# Build init
4646
RUN shards build \
47-
--error-trace \
48-
--static \
49-
--ignore-crystal-version \
50-
--production \
51-
--skip-postinstall
47+
--debug \
48+
--ignore-crystal-version \
49+
--skip-postinstall \
50+
--error-trace \
51+
--no-color \
52+
--static \
53+
-O1 \
54+
--frame-pointers=always \
55+
--link-flags "-no-pie -Wl,-no-pie -Wl,--eh-frame-hdr -Wl,--build-id -rdynamic -Wl,--export-dynamic -lunwind -llzma"
5256

5357
RUN crystal build --static -o bin/task src/sam.cr
5458
RUN crystal build --static -o bin/generate-secrets src/generate-secrets.cr
@@ -57,7 +61,7 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
5761
# Extract binary dependencies
5862
RUN mkdir deps
5963
RUN for binary in /app/bin/* /usr/bin/pg_dump /usr/bin/pg_restore /usr/bin/psql; do \
60-
[ -x "$binary" ] || continue; \
64+
file "$binary" | grep -q "dynamically linked" || continue; \
6165
ldd "$binary" | \
6266
tr -s '[:blank:]' '\n' | \
6367
grep '^/' | \

0 commit comments

Comments
 (0)