forked from evidolob/codeready-workspaces-theia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (64 loc) · 2.75 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
# Copyright (c) 2020 Red Hat, Inc.
# 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:
# Red Hat, Inc. - initial API and implementation
#
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/nodejs-10
FROM registry.access.redhat.com/ubi8/nodejs-10:1-82
USER 0
RUN yum update -y nodejs npm kernel-headers systemd && yum clean all && rm -rf /var/cache/yum
# this script requires a github personal access token
ARG GITHUB_TOKEN=YOUR_TOKEN_HERE
RUN if [[ ${GITHUB_TOKEN} == "YOUR_TOKEN_HERE" ]]; then \
echo; echo "ERROR: Must run this build with a valid GITHUB_TOKEN, eg.,"; \
echo; \
echo " podman build -t crw-theia-builder . -f Dockerfile --build-arg GITHUB_TOKEN=cafef00dd00dbabebeaddabbadd00"; \
echo; exit 1; \
fi
# set alternate branches and versions if required
ARG CHE_THEIA_BRANCH=7.9.x
ARG THEIA_BRANCH=master
ARG NODE_VERSION=10.19.0
ARG YARN_VERSION=1.17.3
ENV NODEJS_VERSION=10 \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:/usr/bin:$PATH
WORKDIR /projects
# much love to https://stackoverflow.com/questions/54397706/how-to-output-a-multiline-string-in-dockerfile-with-a-single-command
RUN echo $'[centos8-AppStream] \n\
name=CentOS-8 - AppStream \n\
baseurl=http://mirror.centos.org/centos-8/8/AppStream/x86_64/os/\n\
gpgcheck=0\n\
enabled=1\n\
\n\
[centos8-BaseOS]\n\
name=CentOS-8 - AppStream\n\
baseurl=http://mirror.centos.org/centos-8/8/BaseOS/x86_64/os/\n\
gpgcheck=0\n\
enabled=1\n\
' >> /etc/yum.repos.d/centos8.repo && cat /etc/yum.repos.d/centos8.repo && \
# do we need java-1.8.0-openjdk?
yum install --nogpgcheck -y wget curl tar gzip bzip2 python36 podman buildah skopeo containers-common
RUN pushd /usr/bin; rm -f python; ln -s ./python36 python; popd && whereis python && echo "PATH = $PATH" && \
/usr/bin/python3 --version && \
ln -s /usr/bin/podman /usr/bin/docker && \
echo "NOTE: using podman as drop-in repacement for docker in /usr/bin" && \
podman --version && docker --version && \
buildah --version && skopeo --version
RUN npm install -g node@${NODE_VERSION} yarn@${YARN_VERSION} && \
echo -n "node " && node --version && \
echo -n "yarn " && yarn --version && \
ln -s /usr/bin/node /usr/bin/nodejs && \
for f in "${HOME}" "/opt/app-root/src/.npm-global"; do \
chgrp -R 0 ${f} && \
chmod -R g+rwX ${f}; \
done
COPY build.sh conf ./
# switch from overlay to vfs in case we're in nested container hell
RUN sed -i /etc/containers/storage.conf -re 's|driver = .+|driver = "vfs"|'
RUN ./build.sh --ctb ${CHE_THEIA_BRANCH} --tb ${THEIA_BRANCH} --all \
--no-tests --no-cache