Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Improve code. Test a lot images.
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Andriienko <[email protected]>
  • Loading branch information
AndrienkoAleksandr committed Jun 3, 2019
1 parent 45a0c23 commit 99ae354
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 21 deletions.
2 changes: 1 addition & 1 deletion che-theia-init-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ sources:
- plugins/ports-plugin
- plugins/task-plugin
- plugins/welcome-plugin
checkoutTo: master
checkoutTo: remoteBinary
2 changes: 1 addition & 1 deletion dockerfiles/build.include
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ build_image() {
printf "${BOLD}Building Docker Image ${IMAGE_NAME} from $DIR directory with tag $TAG${NC}\n"
# Replace macros in Dockerfiles
cat ${DIR}/${DOCKERFILE} | sed s/\$\{BUILD_ORGANIZATION\}/${ORGANIZATION}/ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ | sed s/\$\{BUILD_PARENT_IMAGE\}/${PARENT_IMAGE}/ | sed s/\$\{GIT_BRANCH_NAME\}/${BRANCH}/ | sed s/\$\{GIT_REF\}/"${GIT_REF}"/ > ${DIR}/.Dockerfile
cd "${DIR}" && docker build -f ${DIR}/.Dockerfile -t ${IMAGE_NAME} ${BUILD_ARGS} .
cd "${DIR}" && docker build -f ${DIR}/.Dockerfile --no-cache -t ${IMAGE_NAME} ${BUILD_ARGS} .
rm ${DIR}/.Dockerfile
if [ $? -eq 0 ]; then
printf "Build of ${BLUE}${IMAGE_NAME} ${GREEN}[OK]${NC}\n"
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/theia-dev/e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-dev:${BUILD_TAG}
ARG GITHUB_TOKEN

# Just try to build the latest theia with current image
RUN git clone -b 'master' --single-branch --depth 1 https://github.com/theia-ide/theia theia
RUN git clone -b 'v0.7.0' --single-branch --depth 1 https://github.com/theia-ide/theia theia
RUN cd theia && yarn

304 changes: 300 additions & 4 deletions dockerfiles/theia-endpoint-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ RUN rm -rf /home/workspace/node_modules/@eclipse-che/theia-plugin-ext /home/work
RUN cp -rf /home/workspace/packages/theia-plugin-ext /home/workspace/node_modules/@eclipse-che/theia-plugin-ext

RUN nexe packages/theia-remote/lib/node/plugin-remote.js -t alpine-x64-10.14.2 -o plugin-remote
RUN ls


FROM registry.access.redhat.com/ubi8/ubi-minimal

ENV HOME=/home/theia
COPY --from=builder /home/workspace/plugin-remote /plugin-remote

RUN mkdir /projects /home/theia \
Expand All @@ -76,11 +74,113 @@ RUN mkdir /projects /home/theia \
chmod -R g+rwX ${f}; \
done

ENTRYPOINT /plugin-remote
ADD etc/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

# FROM alpine

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM ubuntu:18.04

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM debian:9

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM fedora:30

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM centos:7

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM busybox

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM node:10.15-alpine
# ENV HOME=/home/theia

# COPY --from=builder /home/workspace/node_modules /home/theia/node_modules
# RUN rm -rf /home/theia/node_modules/@eclipse-che/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-remote
# COPY --from=builder /home/workspace/packages/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-plugin-ext
Expand All @@ -97,3 +197,199 @@ ENTRYPOINT /plugin-remote
# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# opensuse/leap because opensuse depracated
# FROM opensuse/leap

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM cirros

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM clefos

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM mageia:7

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM photon:latest

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]


# FROM photon:latest

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# # alt os
# FROM alt

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]


# FROM amazonlinux

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM open-liberty

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# ENTRYPOINT [ "/plugin-remote" ]

# FROM php

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM oraclelinux

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]

# FROM golang:stretch

# COPY --from=builder /home/workspace/plugin-remote /plugin-remote

# RUN mkdir /projects /home/theia \
# # Store passwd/group as template files
# && cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
# && cat /etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > ${HOME}/group.template \
# # Change permissions to let any arbitrary user
# && for f in "${HOME}" "/etc/passwd" "/etc/group" "/projects"; do \
# echo "Changing permissions on ${f}" && chgrp -R 0 ${f} && \
# chmod -R g+rwX ${f}; \
# done

# ADD etc/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]
2 changes: 2 additions & 0 deletions dockerfiles/theia-endpoint-runtime/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ cp -r "${base_dir}/../../extensions/eclipse-che-theia-plugin-remote/tsconfig.jso

init --name:theia-endpoint-runtime "$@"
build

./retag.sh
6 changes: 3 additions & 3 deletions dockerfiles/theia-endpoint-runtime/etc/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
responsible_shutdown() {
echo ""
echo "Received SIGTERM"
kill -SIGINT ${PID}
kill -INT ${PID}
wait ${PID}
exit;
}
Expand All @@ -47,12 +47,12 @@ set -e

# setup handlers
# on callback, kill the last background process, which is `tail -f /dev/null` and execute the specified handler
trap 'responsible_shutdown' SIGHUP SIGTERM SIGINT
trap 'responsible_shutdown' HUP TERM INT

cd ${HOME}

# run theia endpoint
node /home/theia/lib/node/plugin-remote.js &
/plugin-remote &

PID=$!

Expand Down
3 changes: 3 additions & 0 deletions dockerfiles/theia-endpoint-runtime/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker push aandrienko/che-theia-remote:next
3 changes: 3 additions & 0 deletions dockerfiles/theia-endpoint-runtime/retag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker tag eclipse/che-theia-endpoint-runtime:nightly aandrienko/che-theia-remote:next
Loading

0 comments on commit 99ae354

Please sign in to comment.