docker-library / buildpack-deps

MIT License
445 stars 113 forks source link

Install gcc-arm-linux-gnueabihf and binutils-arm-linux-gnueabihf for cross compiling arm #103

Closed Lindenk closed 3 years ago

Lindenk commented 4 years ago

Cross compiling for arm takes several extra minutes because gcc-arm-linux-gnueabihf and binutils-arm-linux-gnueabihfneed to be installed first during a build. For some images relying on buildpack-deps like the official rust image, cross compiling C bindings requires the C cross compilers.

The fix would be to add gcc-arm-linux-gnueabihf and binutils-arm-linux-gnueabihf to the list of installed packages for the image.

https://github.com/rust-lang/docker-rust/issues/53#event-2929276895

tianon commented 4 years ago

Quoting from https://hub.docker.com/_/buildpack-deps/:

The main tags of this image are the full batteries-included approach. With them, a majority of arbitrary gem install / npm install / pip install should be successful without additional header/development packages.

In that context, I don't think cross-compiling tooling really fits since cross-compiling tools would typically be used to build binaries for something other than the current platform (and this repository is targeting being a use-as-is base, not as a build environment to create things for other platforms).

What I'd recommend is creating for yourself a short Dockerfile which is FROM rust:xxx and installs the necessary/appropriate tooling for your desired use case, and set up something like Docker's automated builds to keep it up-to-date for you.