-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
69 lines (50 loc) · 2.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM eclipse-temurin:17-focal
# hadolint ignore=DL3002
USER root
ARG USER_HOME_DIR="/root"
ENV SCALA_VERSION="2.12.15"
ENV SBT_VERSION="1.7.3"
# Update the repository sources list and install dependencies
RUN apt-get update
RUN apt-get install -y software-properties-common unzip htop rsync openssh-client jq git
# install Java
RUN java -version
RUN mkdir -p /usr/share/man/man1 && \
apt-get update -y
RUN apt-get install unzip -y && \
apt-get autoremove -y && \
apt-get install git -y
# Install Scala
## Piping curl directly in tar
RUN \
apt-get install curl --assume-yes && \
curl -fsL http://www.scala-lang.org/files/archive/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
echo >> /root/.bashrc && \
echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' >> /root/.bashrc
# Install sbt
RUN \
curl -L -o sbt-$SBT_VERSION.deb https://scala.jfrog.io/artifactory/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
sbt -Dsbt.rootdir=true -Djava.io.tmpdir=$HOME sbtVersion
VOLUME "$USER_HOME_DIR/.sbt"
# Install nodejs
RUN \
curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN \
apt-get install nodejs --assume-yes
RUN export NODE_OPTIONS=--max_old_space_size=6000
RUN npm i -g npm@8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8
COPY certs/ /usr/local/share/ca-certificates/
#Import certs to java keystore for sonar cli
RUN keytool -import -trustcacerts -alias salesforce_internal_root_ca_1 -file /usr/local/share/ca-certificates/Salesforce_Internal_GIA_Root_CA_1.pem -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt
RUN keytool -import -trustcacerts -alias salesforce_internal_root_ca_4 -file /usr/local/share/ca-certificates/Salesforce_Internal_Root_CA_4.pem -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt
RUN keytool -import -trustcacerts -alias salesforce_internal_root_ca_3 -file /usr/local/share/ca-certificates/Salesforce_Internal_Root_CA_3.pem -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -noprompt
# Final user and home config
RUN useradd --create-home --shell /bin/bash jenkins
USER jenkins
WORKDIR /home/jenkins