Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
che #13454 Adding Che 7 community images with support of arbitrary us…
Browse files Browse the repository at this point in the history
…er to make them OpenShift compatible

Signed-off-by: Ilya Buziuk <[email protected]>
  • Loading branch information
ibuziuk committed Jul 5, 2019
1 parent 96165c2 commit 0c597e7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG FROM_IMAGE
FROM ${FROM_IMAGE}
USER 0
RUN chmod g=u /etc/passwd
COPY [--chown=0:0] entrypoint.sh /
RUN chmod +x entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

USER 10001
WORKDIR /projects
8 changes: 8 additions & 0 deletions dockerfiles/base_images
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions dockerfiles/build_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

DEFAULT_REGISTRY="quay.io"
REGISTRY=${REGISTRY:-${DEFAULT_REGISTRY}}

while read -r line; do
base_image_name=$(echo $line | cut -f 1 -d ' ')
base_image=$(echo $line | cut -f 2 -d ' ')
echo "Building ${REGISTRY}/eclipse-che/che7-${base_image_name} based on $base_image ..."
docker build -t "${REGISTRY}/eclipse-che/che7-${base_image_name}" --build-arg FROM_IMAGE=$base_image .
done < base_images
8 changes: 8 additions & 0 deletions dockerfiles/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 0c597e7

Please sign in to comment.