1
+ ARG PIPELINES_BASE_VERSION
2
+
3
+ FROM docker.bintray.io/jfrog/pipelines-api:${PIPELINES_BASE_VERSION} AS base
4
+ FROM jfrog-docker-reg2.bintray.io/pipelines-node:1.4.2 AS base2
5
+
6
+ # The new image based on registry.access.redhat.com/ubi
7
+ FROM registry.access.redhat.com/ubi8
8
+
9
+ USER root
10
+
11
+ LABEL name="JFrog Pipelines K8s Node" \
12
+ description="JFrog Pipelines K8s Node image based on the Red Hat Universal Base Image." \
13
+ vendor="JFrog" \
14
+ summary="JFrog Pipelines K8s Node (Red Hat UBI)" \
15
+ com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
16
+
17
+ # Set vars
18
+ ENV DOCKER_VERSION=18.09.9
19
+ ENV NODE_VERSION=10.19.0
20
+
21
+ #RUN apt-get update && \
22
+ # apt-get install sudo grep jq tar curl python-minimal wget ca-certificates rsync vim -y
23
+
24
+
25
+ RUN yum install -y --disableplugin=subscription-manager wget && \
26
+ yum install -y --disableplugin=subscription-manager procps && \
27
+ yum install -y --disableplugin=subscription-manager net-tools && \
28
+ yum install -y --disableplugin=subscription-manager hostname && \
29
+ yum install -y --disableplugin=subscription-manager https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
30
+ yum install -y --disableplugin=subscription-manager sudo grep tar python36 ca-certificates rsync vim
31
+
32
+
33
+
34
+ RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
35
+ ENV NVM_DIR=/root/.nvm
36
+ RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
37
+ RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
38
+ RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
39
+ RUN cp /root/.nvm/versions/node/v${NODE_VERSION}/bin/node /usr/bin/
40
+ RUN cp /root/.nvm/versions/node/v${NODE_VERSION}/bin/npm /usr/bin/
41
+ RUN /root/.nvm/versions/node/v${NODE_VERSION}/bin/npm install leasot@latest -g
42
+
43
+ RUN curl -0 -L https://npmjs.com/install.sh | sh
44
+
45
+ # Get files needed to run Build Plane node
46
+ COPY --from=base /opt/jfrog/pipelines/app/api/bin/buildPlane-x86_64-RHEL_7.rpm /tmp/buildPlane-x86_64-RHEL_7.rpm
47
+ COPY ./executeAffinityGroup_fix.js /tmp
48
+
49
+ RUN yum localinstall -y --disableplugin=subscription-manager /tmp/buildPlane-x86_64-RHEL_7.rpm
50
+ RUN mkdir -p /tmp/var/opt/jfrog/pipelines/reqKick/execute/
51
+ RUN mkdir -p /jfrog-init
52
+ RUN cat /tmp/executeAffinityGroup_fix.js >> /tmp/var/opt/jfrog/pipelines/reqKick/execute/executeAffinityGroup.js
53
+ RUN sed -i '/function __restart(bag) {/,$d' /tmp/var/opt/jfrog/pipelines/reqKick/execute/executeAffinityGroup.js
54
+ RUN cp -fr /tmp/var/opt/jfrog/pipelines/ /jfrog-init
55
+ RUN rm -fr /tmp/var && rm -fr /tmp/*
56
+
57
+ COPY --from=base2 /jfrog-init /jfrog-init
58
+
59
+ # Install app dependencies
60
+ RUN cd /jfrog-init/reqKick; npm install
61
+
62
+ # Install docker client
63
+ RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz -P /tmp/docker && \
64
+ tar -xzf /tmp/docker/docker-$DOCKER_VERSION.tgz --directory /opt && \
65
+ ln -s /opt/docker/docker /usr/bin/docker && \
66
+ rm -fr /tmp/docker
67
+
68
+
69
+ # Install nodejs pm2 monitoring
70
+ RUN npm install pm2 -g
71
+
72
+
73
+ # Add EULA information to meet the Red Hat container image certification requirements
74
+ COPY entplus_EULA.txt /licenses/
75
+
76
+ # Environment needed for Pipelines
77
+ ENV JF_PIPELINES_USER=pipelines \
78
+ PIPELINES_USER_ID=1000721117 \
79
+ PIPELINES_VERSION=${PIPELINES_BASE_VERSION}
80
+
81
+ RUN mkdir -p /home/${JF_PIPELINES_USER}
82
+ RUN useradd -M -s /usr/sbin/nologin --uid ${PIPELINES_USER_ID} --user-group pipelines && \
83
+ chown -R ${PIPELINES_USER_ID}:${PIPELINES_USER_ID} /jfrog-init /home/${JF_PIPELINES_USER}
84
+
85
+ USER ${JF_PIPELINES_USER}
86
+
87
+
88
+ WORKDIR /jfrog-init/reqKick
89
+ CMD ["pm2-runtime", "/jfrog-init/reqKick/reqKick.app.js"]
0 commit comments