1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-19 17:39:02 +00:00
starship/tests/Dockerfile

102 lines
3.2 KiB
Docker
Raw Normal View History

FROM rust
# Create /src as root
RUN mkdir /src && chmod -R a+w /src
# Create non-root user
RUN useradd -ms /bin/bash nonroot
USER nonroot
2019-04-28 17:34:46 +00:00
# Install Node.js
ENV NODE_VERSION 12.0.0
ENV NVM_DIR /home/nonroot/.nvm
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
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.12.1
ENV GOENV_ROOT /home/nonroot/.goenv
2019-05-12 03:58:45 +00:00
ENV PATH $GOENV_ROOT/bin:$GOENV_ROOT/shims:$PATH
RUN git clone https://github.com/syndbg/goenv.git $GOENV_ROOT \
&& eval "$(goenv init -)" \
&& goenv install $GO_VERSION \
&& goenv global $GO_VERSION \
&& chmod -R a+x $GOENV_ROOT
2019-05-12 03:58:45 +00:00
# Check that Go was correctly installed
RUN go version
2019-08-13 22:43:29 +00:00
# Install Ruby
ENV RUBY_VERSION 2.6.3
2019-08-13 22:43:29 +00:00
ENV RBENV_ROOT /home/nonroot/.rbenv
ENV PATH $RBENV_ROOT/bin:$RBENV_ROOT/shims:$PATH
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash \
&& rbenv install $RUBY_VERSION \
&& rbenv global $RUBY_VERSION
# Check that Ruby was correctly installed
RUN ruby --version
# Install Python
2019-11-05 07:23:33 +00:00
ENV PYTHON_VERSION 3.7.5
ENV PYENV_ROOT /home/nonroot/.pyenv
ENV PATH $PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH
RUN curl https://pyenv.run | bash \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& chmod -R a+x $PYENV_ROOT
# Check that Python was correctly installed
RUN python --version
2019-04-28 17:34:46 +00:00
# Install Dotnet
ENV DOTNET_HOME /home/nonroot/dotnet
ENV DOTNET_SDK_VERSION 2.2.402
RUN mkdir -p "$DOTNET_HOME" \
&& dotnet_download="$DOTNET_HOME/../dotnet.tar.gz" \
&& curl -SL --output "$dotnet_download" https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
&& tar -zxf "$dotnet_download" -C "$DOTNET_HOME" \
&& rm "$dotnet_download"
ENV PATH $DOTNET_HOME:$PATH
RUN dotnet help
2019-12-05 18:04:27 +00:00
# Install PHP
ENV PHP_VERSION 7.3.8
ENV PHPENV_ROOT /home/nonroot/.phpenv
ENV PATH $PHPENV_ROOT/bin:$PHPENV_ROOT/shims:$PATH
ENV CONFIGURE_OPTS "--without-tidy --disable-zip"
RUN curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer | bash \
&& phpenv install $PHP_VERSION \
&& phpenv global $PHP_VERSION \
&& chmod -R a+x $PHPENV_ROOT
# Check that PHP was correctly installed
RUN php --version
2019-12-02 22:37:18 +00:00
# Install Mercurial
RUN HGPYTHON3=1 pip install mercurial
# Check that Mercurial was correctly installed
RUN hg --version
# Install Terraform
ENV TERRAFORM_HOME /home/nonroot/terraform
ENV TERRAFORM_VERSION 0.12.14
ENV PATH ${TERRAFORM_HOME}:${PATH}
RUN mkdir -p ${TERRAFORM_HOME} \
&& terraform_download="${TERRAFORM_HOME}/terraform.zip" \
&& curl -SL --output "${terraform_download}" "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" \
&& unzip "${terraform_download}" -d "${TERRAFORM_HOME}" \
&& rm "${terraform_download}"
# Check that terraform was correctly installed
RUN terraform version
2019-12-02 22:37:18 +00:00
2019-04-28 17:34:46 +00:00
# Create blank project
RUN USER=nonroot cargo new --bin /src/starship
WORKDIR /src/starship
2019-04-28 17:34:46 +00:00
# Copy the whole project
COPY . .
2019-04-28 17:34:46 +00:00
# "-Z unstable-options" is required for "--include-ignored"
CMD ["cargo", "test", "--", "-Z", "unstable-options", "--include-ignored"]