2018-12-09 14:58:03 +00:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
2019-01-18 00:31:07 +00:00
|
|
|
ARG NODE_VERSION
|
|
|
|
ARG YARN_VERSION
|
2018-12-09 14:58:03 +00:00
|
|
|
ARG LEIN_VERSION
|
|
|
|
|
|
|
|
# We have to do this because Jenkins doesn't let us
|
|
|
|
# https://issues.jenkins-ci.org/browse/JENKINS-49076
|
2019-01-18 00:31:07 +00:00
|
|
|
ENV PATH=/home/jenkins/.nvm/versions/node/v${NODE_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
2018-12-09 14:58:03 +00:00
|
|
|
LANG=en_US.UTF-8 \
|
|
|
|
LC_ALL=en_US.UTF-8 \
|
|
|
|
LANGUAGE=en_US.UTF-8 \
|
|
|
|
LEIN_HOME=/var/tmp/lein \
|
2019-01-18 00:31:07 +00:00
|
|
|
LEIN_URL=https://raw.githubusercontent.com/technomancy/leiningen/${LEIN_VERSION}/bin/lein \
|
|
|
|
YARN_CACHE_FOLDER=/var/tmp/yarn \
|
|
|
|
NVM_DIR=/home/jenkins/.nvm
|
2018-12-09 14:58:03 +00:00
|
|
|
|
|
|
|
RUN mkdir /var/tmp/npm /var/tmp/lein \
|
|
|
|
&& chmod 777 /var/tmp/npm /var/tmp/lein \
|
|
|
|
&& apt-get update && apt-get -q -y --no-install-recommends install curl software-properties-common \
|
|
|
|
&& add-apt-repository -y ppa:webupd8team/java \
|
|
|
|
&& echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections \
|
|
|
|
&& echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections \
|
|
|
|
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
|
|
|
&& apt-get update \
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y --no-install-recommends install \
|
2019-01-18 00:31:07 +00:00
|
|
|
file jq git wget zip unzip s3cmd build-essential nodejs locales \
|
2018-12-09 14:58:03 +00:00
|
|
|
ca-certificates oracle-java8-installer oracle-java8-set-default \
|
|
|
|
&& locale-gen ${LANG} \
|
2019-01-18 00:31:07 +00:00
|
|
|
&& npm install -g yarn@${YARN_VERSION} \
|
2018-12-09 14:58:03 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
|
|
|
|
|
|
|
|
# These are the UID and GID values used by Jenkins
|
|
|
|
RUN addgroup --gid 1002 jenkins \
|
|
|
|
&& adduser --shell /bin/bash \
|
|
|
|
--disabled-password --gecos "" \
|
|
|
|
--uid 1001 --gid 1002 jenkins \
|
|
|
|
&& su jenkins -c "git config --global user.email 'jenkins'" \
|
|
|
|
&& su jenkins -c "git config --global user.name 'jenkins@status.im'"
|
|
|
|
|
|
|
|
# Leiningen setup
|
2019-01-18 00:31:07 +00:00
|
|
|
RUN wget ${LEIN_URL} -O /usr/local/bin/lein \
|
2018-12-09 14:58:03 +00:00
|
|
|
&& chmod 755 /usr/local/bin/lein \
|
|
|
|
&& lein version
|
|
|
|
|
|
|
|
# Install NVM for Jenkins
|
2019-01-18 00:31:07 +00:00
|
|
|
ADD nvm_install.sh /tmp/nvm_install.sh
|
|
|
|
RUN su -l jenkins -c \
|
|
|
|
"bash /tmp/nvm_install.sh && \
|
|
|
|
. ${NVM_DIR}/nvm.sh && \
|
|
|
|
nvm install ${NODE_VERSION} && \
|
|
|
|
nvm alias default ${NODE_VERSION}"
|
2018-12-09 14:58:03 +00:00
|
|
|
|
|
|
|
LABEL source="https://github.com/status-im/status-react/tree/develop/docker/base" \
|
|
|
|
description="Base Image used for building Status app." \
|
|
|
|
maintainer="jakub@status.im"
|