Public | Automated Build

Last pushed: 3 years ago
Short Description
Rust + Cargo (do not docker pull, see full description)
Full Description

Rust + Cargo


  • The Rust Programming Language
  • Cargo, Rust's Package Manager
  • GDB: The GNU Project Debugger
  • Valgrind
  • racer (available *-racer tagged images)

Based on Debian Jessie

Setup environment (choose one)

Using scripts and persistent containers (recommended)

# specify which rust version to use when creating the container
export DOCKER_RUST_VERSION=1.4.0-racer

# create persistent container
rust-shell create

# run commands
rustc --version
cargo test

# more info
rust-shell help

Or using aliases and throwaway containers

alias rust-shell='docker run --rm -it --volume "${PWD}:${PWD}" --workdir="${PWD}" -e USER="${USER}" rovjuvano/rust-lang:1.4.0 bash -c "\${@:2}" --'
alias cargo='rust-shell run cargo'
alias rustc='rust-shell run rustc'

Example usage

Run tests using cargo

cargo test

Run gdb or valgrind against test binary

rust-shell exec gdb target/debug/my-bin-0123456789abcdef
rust-shell exec valgrind target/debug/my-bin-0123456789abcdef

Get explanation of error

rustc --explain E0001

Set environment variables

rust-shell exec env RUST_BACKTRACE=1 cargo run

Open shell prompt inside container

rust-shell exec /bin/bash


Smoke tested with Docker Toolbox v1.8.1 on MacOS 10.10

Docker Pull Command
Source Repository