Closed Sharrrrk closed 1 year ago
staticx
only has an x86 binary released through pip. And compiling it from source seems like too much effort for the use rocker has of it.
I think a good solution would be to remove the use for staticx
completely. Instead having detect_os
rely only on printing the content "/etc/os-release" from inside of the target docker image and doing the parsing of that on the host with python code. I'll try to create a patch for that.
Ouch, that's a challenge. Python isn't quite as reliable as might be desired for this. Maybe a rust or go detector might make more sense.
I found there's a crate for this https://docs.rs/os-detect/0.1.0/os_detect/ or standard envs https://doc.rust-lang.org/std/env/consts/constant.OS.html Though they don't seem to be quite at the level we need.
Another alternative would be to prebuild the detectors and put them into docker images that can be fetched instead of building it locally.
Here's a potential go library https://github.com/dekobon/distro-detect it doesn't have a lot of traction. The integrated GOOS variable doesn't have quite enough info: https://pkg.go.dev/runtime#pkg-constants
I've looked at https://docs.rs/os-version/0.2.0/os_version/ for this, but it seems the rust compilation step requires some registry cloning, which takes between 1 and 2 minutes on my machine. I don't think that's acceptable. And that's a problem for any rust-based solution. So instead what I propose is using the Go program, which is much lighter to build.
When I am using rocker on Jetson Xavier, an error occurs during os detection process:
rocker --nvidia --x11 --user --home tfoote/drone_demo
It seems to be related with the installation of staticx, yet I could not find a solution to solve it.
Environment:
Linux xavier-5 5.10.65-tegra #1 SMP PREEMPT Wed Apr 6 11:45:49 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux
How to reproduce:
rocker --nvidia --x11 --user --home tfoote/drone_demo