Add current node LTS version to the images list
[mbt-docker.git] / Dockerfile
index 3900fcfa5ba3d6ccb4274322201054c8b7e24133..fd929773639f9342c5418917ab6dc3d1ee7f6cf3 100644 (file)
@@ -21,7 +21,7 @@ RUN set -ex \
 ADD http://aia.pki.co.sap.com/aia/SAP%20Global%20Root%20CA.crt \
     /etc/ssl/certs/SAP_Global_Root_CA.crt
 
-ARG NODE_VERSION=16.17.1
+ARG NODE_VERSION=16.18.0
 
 RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
     && case "${dpkgArch##*-}" in \
@@ -81,7 +81,8 @@ ARG YARN_VERSION=1.22.19
 
 RUN set -ex \
   && savedAptMark="$(apt-mark showmanual)" \
-  && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
+  && apt-get update \
+  && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
   && rm -rf /var/lib/apt/lists/* \
   && for key in \
     6A010C5166006599AA17F08146C2130DFD2497F5 \
@@ -110,6 +111,26 @@ RUN set -ex \
   # smoke test
   && yarn --version
 
+ARG SAPMACHINE_VERSION=11.0.16.1
+
+RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
+    && case "${dpkgArch##*-}" in \
+      amd64) ARCH='amd64';; \
+      *) echo "unsupported architecture"; exit 1 ;; \
+    esac \
+  && set -ex \
+  && apt-get update \
+  && apt-get install -y ca-certificates wget --no-install-recommends \
+  && rm -rf /var/lib/apt/lists/* \
+  && wget -q -O - https://dist.sapmachine.io/debian/sapmachine.key | tee /etc/apt/trusted.gpg.d/sapmachine.gpg.asc \
+  && echo "deb http://dist.sapmachine.io/debian/${ARCH}/ ./" | tee /etc/apt/sources.list.d/sapmachine.list \
+  && apt-get update \
+  && apt-get install -y sapmachine-$(echo ${SAPMACHINE_VERSION} | cut -d. -f1)-jdk=${SAPMACHINE_VERSION} --no-install-recommends \
+  && rm -rf /var/lib/apt/lists/* \
+  && apt-get remove --purge --autoremove -y ca-certificates wget \
+  # smoke test
+  && java --version
+
 ARG MAVEN_VERSION=3.8.6
 ARG SHA=f790857f3b1f90ae8d16281f902c689e4f136ebe584aba45e4b1fa66c80cba826d3e0e52fdd04ed44b4c66f6d3fe3584a057c26dfcac544a60b301e6d0f91c26
 ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
@@ -119,7 +140,7 @@ ENV M2_HOME ${MAVEN_HOME}
 
 RUN set -ex \
   && apt-get update \
-  && apt-get install -y ca-certificates curl openjdk-11-jdk procps --no-install-recommends \
+  && apt-get install -y ca-certificates curl procps --no-install-recommends \
   && rm -rf /var/lib/apt/lists/* \
   && mkdir -p ${MAVEN_HOME} ${MAVEN_HOME}/ref \
   && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
@@ -128,19 +149,25 @@ RUN set -ex \
   && rm -f /tmp/apache-maven.tar.gz \
   && ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn \
   && chmod --recursive a+w "${MAVEN_HOME}"/conf/* \
-  && apt-get remove --purge --autoremove -y curl \
-  # smoke tests
-  && java --version \
+  && apt-get remove --purge --autoremove -y ca-certificates curl \
+  # smoke test
   && mvn --version
 
-# Install SAP e-Mobility requirements
+ARG MBT_VERSION=1.2.18
+
+RUN set -ex \
+  && npm install -g --unsafe-perm mbt@${MBT_VERSION} \
+  && npm cache clean -g --force \
+  # smoke test
+  && mbt --version
+
+# SAP e-Mobility requirements
 RUN set -ex \
   && apt-get update \
-  && apt-get install -y build-essential python3 --no-install-recommends \
+  && apt-get install -y ca-certificates build-essential python3 --no-install-recommends \
   && rm -rf /var/lib/apt/lists/* \
-  && npm install -g mbt \
   # smoke test
-  && mbt --version
+  && python3 --version
 
 WORKDIR /project
 USER ${USER}