2019-05-29 20:58:46 +00:00
|
|
|
FROM rust
|
|
|
|
|
2019-04-28 17:34:46 +00:00
|
|
|
# Install Node.js
|
|
|
|
ENV NODE_VERSION 12.0.0
|
|
|
|
ENV PATH /root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
|
2019-05-29 20:58:46 +00:00
|
|
|
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
2019-04-28 17:34:46 +00:00
|
|
|
# Check that Node.js was correctly installed
|
2019-05-12 03:58:45 +00:00
|
|
|
RUN node --version
|
|
|
|
|
|
|
|
# Install Go
|
|
|
|
ENV GO_VERSION 1.10.0
|
|
|
|
ENV GOENV_ROOT /root/.goenv
|
|
|
|
ENV PATH $GOENV_ROOT/bin:$GOENV_ROOT/shims:$PATH
|
2019-05-29 20:58:46 +00:00
|
|
|
RUN git clone https://github.com/syndbg/goenv.git $GOENV_ROOT \
|
|
|
|
&& eval "$(goenv init -)" \
|
|
|
|
&& goenv install $GO_VERSION \
|
|
|
|
&& goenv global $GO_VERSION
|
2019-05-12 03:58:45 +00:00
|
|
|
# Check that Go was correctly installed
|
|
|
|
RUN go version
|
2019-05-29 20:58:46 +00:00
|
|
|
|
2019-05-14 03:53:26 +00:00
|
|
|
# Install Python
|
2019-05-16 15:40:30 +00:00
|
|
|
ENV PYTHON_VERSION 3.6.8
|
2019-05-14 03:53:26 +00:00
|
|
|
ENV PYENV_ROOT /root/.pyenv
|
2019-05-29 20:58:46 +00:00
|
|
|
ENV PATH $PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH
|
2019-05-14 03:53:26 +00:00
|
|
|
RUN curl https://pyenv.run | bash \
|
|
|
|
&& pyenv install $PYTHON_VERSION \
|
|
|
|
&& pyenv global $PYTHON_VERSION
|
|
|
|
# Check that Python was correctly installed
|
|
|
|
RUN python --version
|
2019-04-28 17:34:46 +00:00
|
|
|
|
|
|
|
# Create blank project
|
|
|
|
RUN USER=root cargo new --bin starship
|
|
|
|
WORKDIR /starship
|
|
|
|
|
|
|
|
# We want dependencies cached, so copy those first
|
2019-05-12 03:58:45 +00:00
|
|
|
COPY ./Cargo.lock ./Cargo.lock
|
|
|
|
COPY ./Cargo.toml ./Cargo.toml
|
2019-04-28 17:34:46 +00:00
|
|
|
|
|
|
|
# Cargo.toml will fail to parse without my_benchmark
|
|
|
|
RUN mkdir benches
|
|
|
|
RUN touch benches/my_benchmark.rs
|
|
|
|
|
|
|
|
# This is a dummy build to get dependencies cached
|
2019-05-14 03:53:26 +00:00
|
|
|
RUN cargo build --release
|
2019-04-28 17:34:46 +00:00
|
|
|
|
|
|
|
# Delete the dummy build
|
|
|
|
RUN rm -rf /starship
|
|
|
|
|
|
|
|
# Create the directory for the real source files
|
|
|
|
RUN mkdir starship
|
|
|
|
WORKDIR /starship
|
|
|
|
|
2019-06-06 12:18:00 +00:00
|
|
|
CMD ["cargo", "test", "--", "--ignored"]
|