jsonxr / docker-rust-onbuild

Create the smallest possible RUST binary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonxr/rust-onbuild

Minimalist Rust Docker image based on the empty image scratch. It does this by statically compiling the rust binaries with all the dependencies required to run.

If you want to use different versions of these libraries, you are probably better off to simply take the Dockerfile and modify it with the exact versions of libaries you want and tag it as your own. You can use docker build args to specify exact versions, but I have not testd this feature.

To build:

bin/build
docker build -f Example.Dockerfile -t hello-rust .

To release:

bin/build --release

Warning

  • In order to use other libraries that require a static library, you will need to compile these yourself in the Docker image.
  • openssl/openssl#7207 - Open issue as of 2019-10-11 that prevents OpenSSL1.1 from compiling. Workaround implemented and documented in Dockerfile

Resources

This image is based on https://github.com/emk/rust-musl-builder.

Improvements:

About

Create the smallest possible RUST binary

License:MIT License


Languages

Language:Dockerfile 88.4%Language:Shell 9.4%Language:Rust 2.3%