Skip to content

Commit 03964d5

Browse files
authored
fix: stop strip from choking on non-binary files in Docker build
The build logic has been updated to use `scanelf` to identify and target only ELF binaries for stripping, avoiding build failures caused by the `strip` command targeting non-binary scripts like `ss-nat` and `ss-setup`.
1 parent 5c47b80 commit 03964d5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docker/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN set -x \
3131
&& make install \
3232
&& cd /usr/local/bin \
3333
&& ls /usr/local/bin/ss-* | xargs -n1 setcap cap_net_bind_service+ep \
34-
&& strip $(ls /usr/local/bin | grep -Ev 'ss-nat') \
34+
&& strip $(scanelf --nobanner -E ET_DYN -E ET_EXEC /usr/local/bin/ss-* | awk '{print $2}') \
3535
&& apk del .build-deps \
3636
# Runtime dependencies setup
3737
&& apk add --no-cache \

0 commit comments

Comments
 (0)