Add support for mdbook (for documentation)

This commit is contained in:
Eric Kidd 2018-04-25 06:52:32 -04:00
parent 7b30114420
commit 96abda6d77
2 changed files with 17 additions and 3 deletions

View file

@ -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

View file

@ -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/