-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support linux-musl-x64 #50
Comments
I just hacked this, using https://github.com/emk/rust-musl-builder to cross-compile warp. I'm building a F# project + dependency on https://github.com/Hopac/Hopac, so my assembly is quite a bit larger than what a C# hello-world would yield (published ~46M, packed ~20M). Relevant .fsproj properties:
warp-musl.patch: diff --git "a/warp-packer/src/main.rs" "b/warp-packer/src/main.rs"
index 616ae45..d361da4 100644
--- "a/warp-packer/src/main.rs"
+++ "b/warp-packer/src/main.rs"
@@ -27,16 +27,16 @@ const VERSION: &str = env!("CARGO_PKG_VERSION");
const RUNNER_MAGIC: &[u8] = b"tVQhhsFFlGGD3oWV4lEPST8I8FEPP54IM0q7daes4E1y3p2U2wlJRYmWmjPYfkhZ0PlT14Ls0j8fdDkoj33f2BlRJavLj3mWGibJsGt5uLAtrCDtvxikZ8UX2mQDCrgE\0";
-const RUNNER_LINUX_X64: &[u8] = include_bytes!("../../target/x86_64-unknown-linux-gnu/release/warp-runner");
-const RUNNER_MACOS_X64: &[u8] = include_bytes!("../../target/x86_64-apple-darwin/release/warp-runner");
-const RUNNER_WINDOWS_X64: &[u8] = include_bytes!("../../target/x86_64-pc-windows-gnu/release/warp-runner.exe");
+const RUNNER_LINUX_X64: &[u8] = include_bytes!("../../target/x86_64-unknown-linux-musl/release/warp-runner");
+//const RUNNER_MACOS_X64: &[u8] = include_bytes!("../../target/x86_64-apple-darwin/release/warp-runner");
+//const RUNNER_WINDOWS_X64: &[u8] = include_bytes!("../../target/x86_64-pc-windows-gnu/release/warp-runner.exe");
lazy_static! {
static ref RUNNER_BY_ARCH: HashMap<&'static str, &'static [u8]> = {
let mut m = HashMap::new();
m.insert("linux-x64", RUNNER_LINUX_X64);
- m.insert("macos-x64", RUNNER_MACOS_X64);
- m.insert("windows-x64", RUNNER_WINDOWS_X64);
+ //m.insert("macos-x64", RUNNER_MACOS_X64);
+ //m.insert("windows-x64", RUNNER_WINDOWS_X64);
m
};
} Dockerfile:
Comparing the image sizes:
It took me a while to realize that just running the App (published or packed) will immediately increase the image to >100M. |
Awesome, I'll have to try that out--thanks! Would still be nice to see it officially supported, so I'll leave the issue open. |
I'd like to be able to use Warp with .NET Core to target
linux-musl-x64
. Right now onlylinux-x64
is supported.Support for
linux-musl-x64
would allow me to layer binaries onto themcr.microsoft.com/dotnet/core/runtime-deps:3.1-alpine
container.This would save over 100 (!) MB in container size compared to the Debian-based
runtime-deps
container, bringing the total to around 23 MB (10 for container, 13 for binary) for a basic Hello World application.And that would be really lightweight.
The text was updated successfully, but these errors were encountered: