FROM ubuntu:kinetic

MAINTAINER Christian Mauduit "ufoot@ufoot.org"
ENV RCL_VERSION=0.1.1
LABEL package="rust-clang-llvm" version="$RCL_VERSION" description="An image to build Rust projects which depend on native libraries using Clang and LLVM."

# Prepare the system, install Debian packages
# -------------------------------------------

RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN apt-get install -yq \
    curl wget git zip unzip \
    llvm-dev libclang-dev clang \
    vim \
    && apt-get clean

# Install Rust
# ------------

RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
ENV PATH /root/.cargo/bin:$PATH

# Mark the sytem as being a rust-clang-llvm image
# --------------------------------------------------------

WORKDIR /opt
RUN echo $GRCC_VERSION > rust-clang-llvm.txt

# Work in /build
# --------------

WORKDIR /build
