diff --git a/recipes/che7/Dockerfile b/recipes/che7/Dockerfile new file mode 100644 index 00000000..2e3699fd --- /dev/null +++ b/recipes/che7/Dockerfile @@ -0,0 +1,9 @@ +ARG FROM_IMAGE +FROM ${FROM_IMAGE} +USER 0 +RUN chmod g=u /etc/passwd +COPY [--chown=0:0] entrypoint.sh / +ENTRYPOINT [ "/entrypoint.sh" ] + +USER 10001 +WORKDIR /projects diff --git a/recipes/che7/base_images b/recipes/che7/base_images new file mode 100644 index 00000000..a0b2eedd --- /dev/null +++ b/recipes/che7/base_images @@ -0,0 +1,8 @@ +dotnet mcr.microsoft.com/dotnet/core/sdk:2.2-stretch +golang golang:1.12.4-stretch +java11-maven maven:3.6.0-jdk-11 +java8-maven maven:3.6.1-jdk-8 +java-gradle gradle:5.2.1-jdk11 +node-alpine node:10.16-alpine +node-ubi8 registry.access.redhat.com/ubi8/nodejs-10 +python-centos centos/python-36-centos7:1 diff --git a/recipes/che7/build_images.sh b/recipes/che7/build_images.sh new file mode 100755 index 00000000..2937923b --- /dev/null +++ b/recipes/che7/build_images.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +REPOSITORY='eclipse-che' +IMAGE_BASENAME='che7' + +while read -r line; do + tag=$(echo $line | cut -f 1 -d ' ') + image=$(echo $line | cut -f 2 -d ' ') + echo "Building ${REPOSITORY}/${IMAGE_BASENAME}-${tag} based on $image ..." + docker build -t "${REPOSITORY}/${IMAGE_BASENAME}-$tag" --build-arg FROM_IMAGE=$image . +done < base_images diff --git a/recipes/che7/entrypoint.sh b/recipes/che7/entrypoint.sh new file mode 100755 index 00000000..c8f8f36a --- /dev/null +++ b/recipes/che7/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +if ! whoami &> /dev/null; then + if [ -w /etc/passwd ]; then + echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd + fi +fi + +exec "$@"