├── .dockerignore ├── Dockerfile ├── LICENSE └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | .git 3 | LICENSE 4 | README.md 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian 2 | 3 | ENV USER root 4 | ENV RUST_VERSION=1.19.0 5 | 6 | RUN apt-get update && \ 7 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ 8 | build-essential \ 9 | ca-certificates \ 10 | curl \ 11 | git \ 12 | openssh-client \ 13 | libssl-dev \ 14 | pkg-config && \ 15 | curl -sO https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init && \ 16 | chmod +x rustup-init && \ 17 | ./rustup-init -y --default-toolchain $RUST_VERSION --no-modify-path && \ 18 | DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y curl && \ 19 | DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \ 20 | rm -rf \ 21 | rustup-init \ 22 | /var/lib/apt/lists/* \ 23 | /tmp/* \ 24 | /var/tmp/* && \ 25 | mkdir /source 26 | 27 | ENV PATH $PATH:/root/.cargo/bin 28 | WORKDIR /source 29 | CMD ["/bin/bash"] 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Jimmy Cuadra 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **DEPRECATION NOTICE** 2 | 3 | There is now an official Docker image for Rust, so this one is no longer maintained. 4 | 5 | * [Rust image on Docker Hub](https://hub.docker.com/_/rust/) 6 | * [Rust image source on GitHub](https://github.com/rust-lang-nursery/docker-rust) 7 | 8 | # docker-rust 9 | 10 | Public trusted images available on: 11 | 12 | * [Docker Hub](https://hub.docker.com/r/jimmycuadra/rust/) 13 | * [Quay.io](https://quay.io/repository/jimmycuadra/rust) 14 | 15 | This repository is used to build a Docker image for the Rust programming language and a few supporting tools. 16 | The image includes `rustc`, `rustdoc`, `cargo`, `git`, SSL certificates, and build essentials, so it should be able to run `cargo build` on most projects out of the box. 17 | The working directory inside the container is `/source`. 18 | You can use this path to mount a Cargo project from the host machine. 19 | 20 | ## Usage 21 | 22 | The following command will drop you into a Bash shell with the current directory on the host shared. From there you can run `rustc`, `rustdoc`, and `cargo` as you please. 23 | 24 | ``` bash 25 | docker run -it --rm -v $(pwd):/source jimmycuadra/rust 26 | ``` 27 | 28 | Build a release without an interactive shell: 29 | 30 | ``` bash 31 | docker run --rm -v $(pwd):/source jimmycuadra/rust cargo build --release 32 | ``` 33 | 34 | ## License 35 | 36 | [MIT](http://opensource.org/licenses/MIT) 37 | --------------------------------------------------------------------------------