From 96abda6d77ab1e9ebfa690a9f39e3269cedc4588 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Wed, 25 Apr 2018 06:52:32 -0400 Subject: [PATCH] Add support for `mdbook` (for documentation) --- Dockerfile | 9 ++++++++- README.md | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 493e2cb..da82e60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ ARG TOOLCHAIN=stable # We also set up a `rust` user by default, in whose account we'll install # the Rust toolchain. This user has sudo privileges if you need to install # any more software. +# +# `mdbook` is the standard Rust tool for making searchable HTML manuals. RUN apt-get update && \ apt-get install -y \ build-essential \ @@ -30,7 +32,12 @@ RUN apt-get update && \ gcc-4.7-multilib-arm-linux-gnueabihf \ && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ - useradd rust --user-group --create-home --shell /bin/bash --groups sudo + useradd rust --user-group --create-home --shell /bin/bash --groups sudo && \ + MDBOOK_VERSION=0.1.5 && \ + curl -LO https://github.com/rust-lang-nursery/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-musl.tar.gz && \ + tar xf mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-musl.tar.gz && \ + mv mdbook /usr/local/bin/ && \ + rm -f mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-musl.tar.gz # Allow sudo without a password. ADD sudoers /etc/sudoers.d/nopasswd diff --git a/README.md b/README.md index 0057cad..7a07f8b 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,17 @@ With a bit of luck, you should be able to just copy your application binary from You can also use the following libraries with a bit of setup: -- SQLite3 with - `diesel`. See [examples/using-diesel](./examples/using-diesel/). +- SQLite3 with `diesel`. See [examples/using-diesel](./examples/using-diesel/). This library also sets up the environment variables needed to compile popular Rust crates using these libraries. +## Extras + +This image also supports the following extra goodies: + +- Basic compilation for `armv7` using `musl-libc`. Not all libraries are supported at the moment, however. +- [`mdbook`][mdbook] for building searchable HTML documentation from Markdown files. Build manuals to use alongside your `cargo doc` output! + ## Making OpenSSL work If your application uses OpenSSL, you will also need to take a few extra steps to make sure that it can find OpenSSL's list of trusted certificates, which is stored in different locations on different Linux distributions. You can do this using [`openssl-probe`](https://crates.io/crates/openssl-probe) as follows: @@ -152,6 +158,7 @@ Either the [Apache 2.0 license](./LICENSE-APACHE.txt), or the [MIT license](./LICENSE-MIT.txt). [Alpine Linux container]: https://hub.docker.com/_/alpine/ +[mdbook]: https://github.com/rust-lang-nursery/mdBook [musl-libc]: http://www.musl-libc.org/ [musl-gcc]: http://www.musl-libc.org/how.html [rustup]: https://www.rustup.rs/