This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
117 lines (101 loc) · 4 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#
# Copyright IBM Corporation 2020 - 2021
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# IBM Corporation - implementation
#
FROM registry.access.redhat.com/ubi8/nodejs-12
# Build Arguments
ARG PRODUCT_VERSION=1.4.1
# Environment and Label Variables
ENV HOME=/home/wazi \
NODEJS_VERSION="12" \
PATH=/usr/lib/jvm/java-1.8.0-openjdk/jre/bin:$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:/usr/bin:$PATH \
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \
PRODUCT="IBM Wazi Developer for Red Hat CodeReady Workspaces" \
COMPANY="IBM" \
VERSION=$PRODUCT_VERSION \
ZOWE_CLI_VERSION="6.33.3" \
RELEASE="1" \
SUMMARY="IBM Wazi Developer for Workspaces" \
DESCRIPTION="IBM Wazi Developer for Red Hat CodeReady Workspaces - Sidecar" \
PRODTAG="ibm-wazi-developer-for-workspaces-codeready" \
CLOUDPAK_ID="9d41d2d8126f4200b62ba1acc0dffa2e" \
CLOUDPAK_METRIC="VIRTUAL_PROCESSOR_CORE" \
PRODUCT_NAME="Code" \
PRODUCT_ID="0e775d0d3f354a5ca074a6a4398045f3" \
PRODUCT_METRIC="AUTHORIZED_USER" \
PRODUCT_CHARGED_CONTAINERS="All" \
PRODUCT_CLOUDPAK_RATIO="5:1"
LABEL name="$PRODUCT" \
vendor="$COMPANY" \
version="$VERSION" \
release="$RELEASE" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="$SUMMARY" \
io.openshift.tags="$PRODTAG,$COMPANY" \
com.redhat.component="$PRODTAG" \
io.openshift.expose-services="" \
cloudpakName="$PRODUCT" \
cloudpakId="$CLOUDPAK_ID" \
cloudpakMetric="$CLOUDPAK_METRIC" \
productName="$PRODUCT_NAME" \
productVersion="$VERSION" \
productID="$PRODUCT_ID" \
productMetric="$PRODUCT_METRIC" \
productChargedContainers="$PRODUCT_CHARGED_CONTAINERS" \
productCloudpakRatio="$PRODUCT_CLOUDPAK_RATIO"
USER root
# add user, install java jdk, python, curl, bzip, apply permissions
RUN rm -rf /etc/mysql /etc/my.cnf* && \
useradd -u 1000 -G wheel,root -d /home/wazi --shell /bin/bash -m wazi && \
yum remove -y kernel-headers && \
yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel java-1.8.0-openjdk-headless python36 && \
yum update -y --nobest && \
yum update -y nodejs npm python3-six pango libnghttp2 && \
yum clean all && rm -rf /var/cache/yum && \
mkdir -p /projects && \
mkdir -p /licenses && \
for f in "/home/wazi" "/etc/passwd" "/etc/group" "/projects"; do\
chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done && \
mkdir -p ${HOME}/rse-rest /opt/app-root/src/.npm-global/bin && \
ln -s /usr/bin/node /usr/bin/nodejs
# Install Zowe CLI
RUN npm install -g @zowe/cli@$ZOWE_CLI_VERSION --ignore-scripts
# TODO Installing Keytar and Secure Credentials TODO
#RUN npm install -g keytar --ignore-scripts && \
# npm install -g @zowe/cli@zowe-v1-lts --ignore-scripts && \
# npm install -g @zowe/secure-credential-store-for-zowe-cli@zowe-v1-lts --ignore-scripts
# Copy RSE API for Zowe CLI Plugin and License
COPY ibm-rse-api-for-zowe-cli.tgz ${HOME}/rse-rest/ibm-rse-api-for-zowe-cli.tgz
COPY LICENSE /licenses/
# Install RSE API for Zowe CLI Plugin
RUN npm install -g "${HOME}/rse-rest/ibm-rse-api-for-zowe-cli.tgz" && \
rm -rf ${HOME}/rse-rest
# Apply Permissions
RUN for f in "${HOME}" "/opt/app-root/src/.npm-global"; do \
chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done && \
echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages"
WORKDIR ${HOME}
# Add GitConfig and Profile to Zowe CLI Install
COPY --chown=wazi:wazi gitconfig.txt ${HOME}/.gitconfig
COPY --chown=wazi:wazi profile.txt ${HOME}/.profile
RUN ln -sf ${HOME}/.profile ${HOME}/.bashrc
# Wazi User
USER wazi
ADD etc/entrypoint.sh ${HOME}/entrypoint.sh
ENV SHELL=/bin/bash
ENTRYPOINT ["/home/wazi/entrypoint.sh"]
WORKDIR /projects
CMD tail -f /dev/null