Skip to content

Commit a358bb6

Browse files
author
John Peterson
authored
Merge pull request #55 from jfrog/XrayRabbitmqFixes
Openshift Pipeline Images, Xray Call Home Fix and JFrog Rabbitmq Image cleanup
2 parents be144a7 + 33d5c96 commit a358bb6

25 files changed

+915
-18
lines changed

Diff for: customize-example/Dockerfile.redhat-ubi

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LABEL name="JFrog Artifactory Pro" \
2020

2121
# Environment needed for Artifactory
2222
ENV ARTIFACTORY_USER_NAME=artifactory \
23-
ARTIFACTORY_USER_ID=1030 \
23+
ARTIFACTORY_USER_ID=1000721030 \
2424
ARTIFACTORY_HOME=/opt/jfrog/artifactory \
2525
ARTIFACTORY_DATA=/var/opt/jfrog/artifactory \
2626
ARTIFACTORY_EXTRA_CONF=/artifactory_extra_conf \
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# BITNAMI DEBIAN-10 DOCKERFILE CAN BE FOUND HERE:
2+
# https://github.com/bitnami/bitnami-docker-rabbitmq/blob/master/3.8/debian-10/Dockerfile
3+
# JFROG REDHAT UBI PORT TO WORK IN BITNAMI RABBITMQ HELM CHARTS
4+
5+
FROM bitnami/rabbitmq:3.8.3-debian-10-r40 as base
6+
7+
FROM registry.access.redhat.com/ubi8
8+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
9+
LABEL name="JFrog Rabbit MQ" \
10+
description="JFrog Rabbit MQ image based on the Red Hat Universal Base Image." \
11+
vendor="JFrog" \
12+
summary="JFrog Rabbit MQ (Red Hat UBI)" \
13+
com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
14+
15+
ARG RABBITMQ_VERSION=3.8.3
16+
17+
LABEL io.k8s.description="Lightweight open source message broker" \
18+
io.k8s.display-name="RabbitMQ" \
19+
io.openshift.expose-services="4369:epmd, 5671:amqp, 5672:amqp, 15672:http" \
20+
io.openshift.tags="rabbitmq"
21+
22+
# FIX THE LOCALE ISSUE
23+
RUN yum install -y --disableplugin=subscription-manager -y openssl curl ca-certificates fontconfig gzip glibc-langpack-en tar \
24+
&& yum -y --disableplugin=subscription-manager update; yum --disableplugin=subscription-manager clean all
25+
26+
27+
ENV GPG_KEY="0A9AF2115F4687BD29803A206B73A36E6026DFCA" \
28+
HOME=/var/lib/rabbitmq \
29+
RABBITMQ_HOME=/opt/rabbitmq \
30+
RABBITMQ_LOGS=- \
31+
RABBITMQ_SASL_LOGS=- \
32+
LANG=en_US.UTF-8 \
33+
LANGUAGE=en_US.:en \
34+
LC_ALL=en_US.UTF-8
35+
36+
RUN yum install -y --disableplugin=subscription-manager xz
37+
RUN set -xe && \
38+
curl -LO https://github.com/rabbitmq/erlang-rpm/releases/download/v23.0/erlang-23.0-1.el8.x86_64.rpm && \
39+
rpm -Uvh ./erlang-23.0-1.el8.x86_64.rpm && \
40+
rm *.rpm && \
41+
INSTALL_PKGS="wget procps net-tools hostname" && \
42+
yum install -y $INSTALL_PKGS && \
43+
rm -rf /var/cache/yum
44+
45+
# COPY OVER THE RABBITMQ LICENSES INTO THE FOLDER FOR REDHAT TO SCAN
46+
COPY --from=base /opt/bitnami /opt/bitnami
47+
RUN mkdir -p /licenses && chmod 0755 /licenses && cp -rf /opt/bitnami/rabbitmq/licenses/* /licenses
48+
49+
RUN mkdir -p /opt/bitnami/rabbitmq/ && chown -R 0777 /opt/bitnami/rabbitmq/ && chown -R 1000721001:1000721001 /opt/bitnami/rabbitmq
50+
RUN mkdir -p /var/log/rabbitmq/log/ && chmod -R 0777 /var/log
51+
RUN mkdir -p /bitnami && chmod -R 0777 /bitnami
52+
ENV BITNAMI_APP_NAME="rabbitmq" \
53+
LANG="en_US.UTF-8" \
54+
LANGUAGE="en_US:en"
55+
56+
EXPOSE 4369 5672 15672 25672
57+
58+
USER 1000721001
59+
ENV PATH=/opt/bitnami/rabbitmq/sbin:$PATH
60+
RUN mkdir -p /opt/bitnami/rabbitmq/test
61+
ENTRYPOINT [ "/opt/bitnami/scripts/rabbitmq/entrypoint.sh" ]
62+
CMD [ "/opt/bitnami/scripts/rabbitmq/run.sh" ]
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARG PIPELINES_BASE_VERSION
2+
3+
FROM docker.bintray.io/jfrog/pipelines-api:${PIPELINES_BASE_VERSION} AS base
4+
5+
# The new image based on registry.access.redhat.com/ubi
6+
FROM registry.access.redhat.com/ubi8/nodejs-10
7+
8+
USER root
9+
10+
LABEL name="JFrog Pipelines API" \
11+
description="JFrog Pipelines API image based on the Red Hat Universal Base Image." \
12+
vendor="JFrog" \
13+
summary="JFrog Pipelines API (Red Hat UBI)" \
14+
com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
15+
16+
# Environment needed for Pipelines
17+
ENV JF_PIPELINES_USER=pipelines \
18+
PIPELINES_USER_ID=1000721117 \
19+
PIPELINES_VERSION=${PIPELINES_BASE_VERSION} \
20+
JF_PRODUCT_HOME=/opt/jfrog/pipelines \
21+
JF_PRODUCT_DATA_INTERNAL=/var/opt/jfrog/pipelines \
22+
SERVICE_NAME=api \
23+
APP_HOME_DIR=/opt/jfrog/pipelines/app/api \
24+
LOG_DIR=/opt/jfrog/pipelines/var/log
25+
26+
ENV LOG_DIR=/opt/jfrog/pipelines/var/log
27+
ENV NODE_PATH=/opt/jfrog/pipelines/app/node_modules
28+
ENV API_BIN_DIR /opt/jfrog/pipelines/app/api/bin
29+
30+
# COPY IN PIPELINES FROM BASE IMAGE
31+
COPY --from=base /opt/jfrog/pipelines/app/api /opt/jfrog/pipelines/app/api
32+
33+
# Add EULA information to meet the Red Hat container image certification requirements
34+
COPY entplus_EULA.txt /licenses/
35+
36+
RUN mkdir -p /var/opt/jfrog && chmod 0777 /var/opt/jfrog
37+
38+
RUN useradd -M -s /usr/sbin/nologin --uid ${PIPELINES_USER_ID} --user-group pipelines && \
39+
chown -R ${PIPELINES_USER_ID}:${PIPELINES_USER_ID} /opt/jfrog/pipelines /var/opt/jfrog && \
40+
yum install -y --disableplugin=subscription-manager wget && \
41+
yum install -y --disableplugin=subscription-manager procps && \
42+
yum install -y --disableplugin=subscription-manager net-tools && \
43+
yum install -y --disableplugin=subscription-manager hostname
44+
45+
RUN mkdir -p /opt/jfrog/pipelines/var/tmp
46+
RUN mkdir -p $LOG_DIR
47+
USER ${JF_PIPELINES_USER}
48+
WORKDIR /opt/jfrog/pipelines/app/api
49+
CMD ["node","api.app.js"]
50+
EXPOSE 30000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# The new image based on registry.access.redhat.com/ubi
2+
FROM registry.access.redhat.com/ubi8
3+
4+
USER root
5+
6+
LABEL name="JFrog Pipelines Init Container" \
7+
description="JFrog Pipelines Init Container image based on the Red Hat Universal Base Image." \
8+
vendor="JFrog" \
9+
summary="JFrog Pipelines Init Container (Red Hat UBI)" \
10+
com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
11+
12+
# install the necessary programs for the init container
13+
RUN yum install -y --disableplugin=subscription-manager nc
14+
RUN yum install -y --disableplugin=subscription-manager libcap libcap-ng
15+
# Add EULA information to meet the Red Hat container image certification requirements
16+
COPY entplus_EULA.txt /licenses/
17+
18+
# Environment needed for Pipelines
19+
ENV JF_PIPELINES_USER=pipelines \
20+
PIPELINES_USER_ID=1000721117
21+
22+
RUN mkdir -p /home/${JF_PIPELINES_USER}
23+
RUN useradd -M -s /usr/sbin/nologin --uid ${PIPELINES_USER_ID} --user-group ${JF_PIPELINES_USER} && \
24+
chown -R ${PIPELINES_USER_ID}:${PIPELINES_USER_ID} /home/${JF_PIPELINES_USER}
25+
26+
USER ${JF_PIPELINES_USER}
27+
28+
WORKDIR /home/${JF_PIPELINES_USER}
29+
30+
ENTRYPOINT ["bash"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
ARG PIPELINES_BASE_VERSION
2+
3+
FROM docker.bintray.io/jfrog/pipelines-installer:${PIPELINES_BASE_VERSION} AS base
4+
5+
# The new image based on registry.access.redhat.com/ubi
6+
FROM registry.access.redhat.com/ubi8/nodejs-10
7+
8+
USER root
9+
10+
LABEL name="JFrog Pipelines Installer" \
11+
description="JFrog Pipelines Installer image based on the Red Hat Universal Base Image." \
12+
vendor="JFrog" \
13+
summary="JFrog Pipelines Installer (Red Hat UBI)" \
14+
com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
15+
16+
# Environment needed for Pipelines
17+
ENV JF_PIPELINES_USER=pipelines \
18+
PIPELINES_USER_ID=1000721117 \
19+
PIPELINES_VERSION=${PIPELINES_BASE_VERSION} \
20+
JF_PRODUCT_HOME=/opt/jfrog/pipelines \
21+
JF_PRODUCT_DATA_INTERNAL=/var/opt/jfrog/pipelines
22+
23+
ENV NODE_PATH /usr/local/lib/node_modules
24+
ENV TMP_DIR /opt/jfrog/pipelines/var/tmp
25+
ENV SRC_DIR /opt/jfrog/pipelines/installer
26+
ENV DEPENDENCIES /opt/jfrog/pipelines/dependencies
27+
28+
# COPY IN PIPELINES FROM BASE IMAGE
29+
COPY --from=base /usr/local/lib /usr/local/lib
30+
COPY --from=base /opt/jfrog/pipelines/var/tmp /opt/jfrog/pipelines/var/tmp
31+
COPY --from=base /opt/jfrog/pipelines /opt/jfrog/pipelines
32+
33+
# Add EULA information to meet the Red Hat container image certification requirements
34+
COPY entplus_EULA.txt /licenses/
35+
36+
RUN mkdir -p /var/opt/jfrog && chmod 0777 /var/opt/jfrog
37+
RUN mkdir p /opt/jfrog/pipelines/var/etc/ && chmod 0777 /opt/jfrog/pipelines/var/etc/
38+
39+
RUN useradd -M -s /usr/sbin/nologin --uid ${PIPELINES_USER_ID} --user-group pipelines && \
40+
chown -R ${PIPELINES_USER_ID}:${PIPELINES_USER_ID} /opt/jfrog/pipelines /var/opt/jfrog && \
41+
yum install -y --disableplugin=subscription-manager wget && \
42+
yum install -y --disableplugin=subscription-manager procps && \
43+
yum install -y --disableplugin=subscription-manager net-tools && \
44+
yum install -y --disableplugin=subscription-manager https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
45+
yum install -y --disableplugin=subscription-manager hostname python36 python3-pip nc
46+
47+
RUN yum install -y --disableplugin=subscription-manager http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-release-1.0-21.el7.art.noarch.rpm && \
48+
yum install -y --disableplugin=subscription-manager http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/oniguruma-5.9.5-3.el7.art.x86_64.rpm && \
49+
yum install -y --disableplugin=subscription-manager http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/jq-1.5-1.el7.art.x86_64.rpm
50+
51+
RUN wget https://github.com/mikefarah/yq/releases/download/3.4.0/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
52+
53+
# install psql
54+
RUN yum install -y --disableplugin=subscription-manager https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-8-x86_64/postgresql10-libs-10.14-1PGDG.rhel8.x86_64.rpm && \
55+
yum install -y --disableplugin=subscription-manager https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-8-x86_64/postgresql10-10.14-1PGDG.rhel8.x86_64.rpm
56+
57+
RUN mkdir -p /usr/local/bin && cp -rf /usr/bin/psql /usr/local/bin/psql
58+
USER ${JF_PIPELINES_USER}
59+
WORKDIR /opt/jfrog/pipelines/installer
60+
ENTRYPOINT ["/bin/bash", "execUtil.sh"]
+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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"]
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ARG PIPELINES_BASE_VERSION
2+
3+
FROM docker.bintray.io/jfrog/pipelines-micro:${PIPELINES_BASE_VERSION} AS base
4+
5+
# The new image based on registry.access.redhat.com/ubi
6+
FROM registry.access.redhat.com/ubi8/nodejs-10
7+
8+
USER root
9+
10+
LABEL name="JFrog Pipelines Micro" \
11+
description="JFrog Pipelines Micro image based on the Red Hat Universal Base Image." \
12+
vendor="JFrog" \
13+
summary="JFrog Pipelines Micro (Red Hat UBI)" \
14+
com.jfrog.license_terms="https://jfrog.com/platform/enterprise-plus-eula/"
15+
16+
# Environment needed for Pipelines
17+
ENV JF_PIPELINES_USER=pipelines \
18+
PIPELINES_USER_ID=1000721117 \
19+
PIPELINES_VERSION=${PIPELINES_BASE_VERSION} \
20+
JF_PRODUCT_HOME=/opt/jfrog/pipelines \
21+
JF_PRODUCT_DATA_INTERNAL=/var/opt/jfrog/pipelines \
22+
SERVICE_NAME=www \
23+
APP_HOME_DIR=/opt/jfrog/pipelines/app/www \
24+
LOG_DIR=/opt/jfrog/pipelines/var/log \
25+
NODE_PATH=/opt/jfrog/pipelines/app/node_modules \
26+
EXEC_TEMPLATES_DIR=/opt/jfrog/pipelines/app/execTemplates \
27+
HOME=/home \
28+
OLDPWD=/home \
29+
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
30+
31+
# COPY IN PIPELINES FROM BASE IMAGE
32+
COPY --from=base /opt/jfrog/pipelines /opt/jfrog/pipelines
33+
COPY --from=base /home /home
34+
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
35+
# Add EULA information to meet the Red Hat container image certification requirements
36+
COPY entplus_EULA.txt /licenses/
37+
38+
RUN mkdir -p /var/opt/jfrog && chmod 0777 /var/opt/jfrog
39+
40+
RUN useradd -M -s /usr/sbin/nologin --uid ${PIPELINES_USER_ID} --user-group pipelines && \
41+
chown -R ${PIPELINES_USER_ID}:${PIPELINES_USER_ID} /opt/jfrog/pipelines /var/opt/jfrog && \
42+
yum install -y --disableplugin=subscription-manager wget && \
43+
yum install -y --disableplugin=subscription-manager procps && \
44+
yum install -y --disableplugin=subscription-manager net-tools && \
45+
yum install -y --disableplugin=subscription-manager hostname
46+
47+
RUN mkdir -p /opt/jfrog/pipelines/var/tmp
48+
RUN mkdir -p $LOG_DIR
49+
50+
USER ${JF_PIPELINES_USER}
51+
WORKDIR /opt/jfrog/pipelines/app/micro/nexec
52+
CMD ["node","app.js"]
53+
EXPOSE 30001

0 commit comments

Comments
 (0)