Skip to content

fix(install): add BusyBox compatibility fallback#1032

Merged
schollz merged 1 commit intoschollz:mainfrom
murataslan1:fix/busybox-install-compat
Dec 23, 2025
Merged

fix(install): add BusyBox compatibility fallback#1032
schollz merged 1 commit intoschollz:mainfrom
murataslan1:fix/busybox-install-compat

Conversation

@murataslan1
Copy link
Copy Markdown
Contributor

Fixes #1027

Summary

Add fallback mechanism for BusyBox compatibility in the install script.

Problem

BusyBox's install command (used in debian:stable-slim, netshoot, alpine, etc.) does not support -C (compare), -b (backup), or -S (backup suffix) flags, causing the install to fail with:

install: unrecognized option: C

Solution

  1. Try GNU install flags first (-C -b -S)
    1. If that fails, fall back to simple install -m 755
    1. If install command is completely unavailable, fall back to cp + chmod 755

Changes

  • Modified install_file_linux() in src/install/default.txt
    • Added 2>/dev/null to suppress errors from unsupported flags
    • Added cp/chmod fallback as last resort

Testing

# Test in netshoot (BusyBox-based)
docker run -it --rm nicolaka/netshoot bash -c "curl https://getcroc.schollz.com | bash"

Fixes schollz#1027

BusyBox's install command does not support -C (compare), -b (backup),
or -S (backup suffix) flags. When these flags fail, fall back to:
1. Simple 'install -m 755' command
2. If install completely unavailable, use cp + chmod

This allows croc to be installed in minimal Docker containers like
debian:stable-slim, netshoot, alpine, etc. using the bash installer.
@ToshmatovDeveloper
Copy link
Copy Markdown

Not bad

@murataslan1
Copy link
Copy Markdown
Contributor Author

@schollz Thanks for maintaining this great project! I've tested this fix on multiple minimal Docker containers (debian:stable-slim, alpine, netshoot) and it works well. Please let me know if you'd like any changes or additional testing. Happy to adjust anything! 🙏

@ToshmatovDeveloper
Copy link
Copy Markdown

I think it dont need any changes)

@murataslan1
Copy link
Copy Markdown
Contributor Author

@ToshmatovDeveloper Thanks for the review and feedback! Really appreciate it.

@schollz schollz merged commit 8f5d626 into schollz:main Dec 23, 2025
1 check passed
@schollz
Copy link
Copy Markdown
Owner

schollz commented Dec 23, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: failed to install inside debian:stable-slim (maybe other) based docker containers

3 participants