From 491ad46af23786021010cfe9da10390781da8b20 Mon Sep 17 00:00:00 2001 From: dkwon17 Date: Tue, 10 Dec 2024 21:01:56 +0000 Subject: [PATCH] Remove ubi8/udi8 source code Signed-off-by: dkwon17 --- ...worksapce-smoke-test-on-minikube-ubi9.yaml | 2 - base/ubi8/.stow-local-ignore | 12 - base/ubi8/Dockerfile | 171 ------- base/ubi8/entrypoint.sh | 5 - base/ubi8/kubedock_setup.sh | 55 --- base/ubi8/podman-wrapper.sh | 38 -- universal/ubi8/Dockerfile | 430 ------------------ universal/ubi8/containers.conf | 4 - universal/ubi8/entrypoint.sh | 26 -- 9 files changed, 743 deletions(-) delete mode 100644 base/ubi8/.stow-local-ignore delete mode 100644 base/ubi8/Dockerfile delete mode 100644 base/ubi8/entrypoint.sh delete mode 100755 base/ubi8/kubedock_setup.sh delete mode 100755 base/ubi8/podman-wrapper.sh delete mode 100644 universal/ubi8/Dockerfile delete mode 100644 universal/ubi8/containers.conf delete mode 100755 universal/ubi8/entrypoint.sh diff --git a/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml b/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml index 7ef56b51..9a550326 100644 --- a/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml +++ b/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml @@ -17,8 +17,6 @@ on: - '**/*.md' - .devfile.yaml - LICENSE - - 'base/ubi8/**' - - 'universal/ubi8/**' env: USERSTORY: CloneGitRepoAPI diff --git a/base/ubi8/.stow-local-ignore b/base/ubi8/.stow-local-ignore deleted file mode 100644 index e4a7df98..00000000 --- a/base/ubi8/.stow-local-ignore +++ /dev/null @@ -1,12 +0,0 @@ -# .viminfo cannot be a symlink for security reasons -\.viminfo - -# We store bash related files in /home/tooling/ so they aren't overriden if persistUserHome is enabled -# but we don't want them to be symbolic links (or to cause stow conflicts). They will be copied to /home/user/ manually. -\.bashrc -\.bash_profile - -# Ignore absolute symbolic links, as they are not supported by stow -\.krew -\.sdkman -\.local/bin/podman diff --git a/base/ubi8/Dockerfile b/base/ubi8/Dockerfile deleted file mode 100644 index 4bfcd43b..00000000 --- a/base/ubi8/Dockerfile +++ /dev/null @@ -1,171 +0,0 @@ -# syntax=docker/dockerfile:1.3-labs - -# https://registry.access.redhat.com/ubi8/ubi -FROM registry.access.redhat.com/ubi8/ubi:8.10-1132 -LABEL maintainer="Red Hat, Inc." - -LABEL com.redhat.component="devfile-base-container" -LABEL name="devfile/base-developer-image" -LABEL version="ubi8" - -#label for EULA -LABEL com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" - -#labels for container catalog -LABEL summary="devfile base developer image" -LABEL description="Image with base developers tools. Languages SDK and runtimes excluded." -LABEL io.k8s.display-name="devfile-developer-base" -LABEL io.openshift.expose-services="" - -USER 0 - -ENV HOME=/home/tooling -RUN mkdir -p /home/tooling/ - -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ - dnf update -y && \ - dnf install -y bash curl diffutils git git-lfs iproute jq less lsof man nano procps p7zip p7zip-plugins \ - perl-Digest-SHA net-tools openssh-clients rsync socat sudo time vim wget zip stow && \ - dnf clean all - -## podman buildah skopeo -RUN dnf -y module enable container-tools:rhel8 && \ - dnf -y update && \ - dnf -y reinstall shadow-utils && \ - dnf -y install podman buildah skopeo fuse-overlayfs && \ - dnf clean all - -## gh-cli -RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - GH_VERSION="2.45.0"; \ - GH_ARCH="linux_amd64"; \ - GH_TGZ="gh_${GH_VERSION}_${GH_ARCH}.tar.gz"; \ - GH_TGZ_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_TGZ}"; \ - GH_CHEKSUMS_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_checksums.txt"; \ - curl -sSLO "${GH_TGZ_URL}"; \ - curl -sSLO "${GH_CHEKSUMS_URL}"; \ - sha256sum --ignore-missing -c "gh_${GH_VERSION}_checksums.txt" 2>&1 | grep OK; \ - tar -zxv --no-same-owner -f "${GH_TGZ}"; \ - mv "gh_${GH_VERSION}_${GH_ARCH}"/bin/gh /usr/local/bin/; \ - mv "gh_${GH_VERSION}_${GH_ARCH}"/share/man/man1/* /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" - -## ripgrep -RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - RG_VERSION="13.0.0"; \ - RG_ARCH="x86_64-unknown-linux-musl"; \ - RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz"; \ - RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}"; \ - curl -sSLO "${RG_TGZ_URL}"; \ - tar -zxv --no-same-owner -f "${RG_TGZ}"; \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/rg /usr/local/bin/; \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/doc/rg.1 /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" - -## bat -RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - BAT_VERSION="0.18.3"; \ - BAT_ARCH="x86_64-unknown-linux-musl"; \ - BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz"; \ - BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}"; \ - curl -sSLO "${BAT_TGZ_URL}"; \ - tar -zxv --no-same-owner -f "${BAT_TGZ}"; \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat /usr/local/bin/; \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat.1 /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" - -## fd -RUN \ - TEMP_DIR="$(mktemp -d)" && \ - cd "${TEMP_DIR}" && \ - FD_VERSION="8.7.0" && \ - FD_ARCH="x86_64-unknown-linux-musl" &&\ - FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz" && \ - FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}" && \ - curl -sSLO "${FD_TGZ_URL}" && \ - tar -xv --no-same-owner -f "${FD_TGZ}" && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd /usr/local/bin && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd.1 /usr/local/share/man/man1 && \ - cd - && \ - rm -rf "${TEMP_DIR}" - -# Define user directory for binaries -ENV PATH="/home/user/.local/bin:$PATH" - -# Set up environment variables to note that this is -# not starting with usernamespace and default to -# isolate the filesystem with chroot. -ENV _BUILDAH_STARTED_IN_USERNS="" BUILDAH_ISOLATION=chroot - -# Tweaks to make rootless buildah work -RUN touch /etc/subgid /etc/subuid && \ - chmod g=u /etc/subgid /etc/subuid /etc/passwd && \ - echo user:10000:65536 > /etc/subuid && \ - echo user:10000:65536 > /etc/subgid - -# Adjust storage.conf to enable Fuse storage. -RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf -RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \ - touch /var/lib/shared/overlay-images/images.lock; \ - touch /var/lib/shared/overlay-layers/layers.lock - -# But use VFS since not all environments support overlay with Fuse backend -RUN mkdir -p "${HOME}"/.config/containers && \ - (echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf && \ - chown -R 10001 "${HOME}"/.config - -# Add kubedock -ENV KUBEDOCK_VERSION 0.15.5 -ENV KUBECONFIG=/home/user/.kube/config -RUN curl -L https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_linux_amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/kubedock -COPY --chown=0:0 kubedock_setup.sh /usr/local/bin/kubedock_setup - -# Configure Podman wrapper -ENV PODMAN_WRAPPER_PATH=/usr/bin/podman.wrapper -ENV ORIGINAL_PODMAN_PATH=/usr/bin/podman.orig -COPY --chown=0:0 podman-wrapper.sh "${PODMAN_WRAPPER_PATH}" - -COPY --chown=0:0 podman-wrapper.sh /usr/bin/podman.wrapper -RUN mv /usr/bin/podman "${ORIGINAL_PODMAN_PATH}" - -COPY --chown=0:0 entrypoint.sh / -COPY --chown=0:0 .stow-local-ignore /home/tooling/ -RUN \ - # add user and configure it - useradd -u 10001 -G wheel,root -d /home/user --shell /bin/bash -m user && \ - # Setup $PS1 for a consistent and reasonable prompt - touch /etc/profile.d/udi_prompt.sh && \ - chown 10001 /etc/profile.d/udi_prompt.sh && \ - echo "export PS1='\W \`git branch --show-current 2>/dev/null | sed -r -e \"s@^(.+)@\(\1\) @\"\`$ '" >> /etc/profile.d/udi_prompt.sh && \ - # Copy the global git configuration to user config as global /etc/gitconfig - # file may be overwritten by a mounted file at runtime - cp /etc/gitconfig ${HOME}/.gitconfig && \ - chown 10001 ${HOME}/ ${HOME}/.viminfo ${HOME}/.gitconfig ${HOME}/.stow-local-ignore && \ - # Set permissions on /etc/passwd and /home to allow arbitrary users to write - chgrp -R 0 /home && \ - chmod -R g=u /etc/passwd /etc/group /home && \ - chmod +x /entrypoint.sh && \ - # Create symbolic links from /home/tooling/ -> /home/user/ - stow . -t /home/user/ -d /home/tooling/ && \ - # .viminfo cannot be a symbolic link for security reasons, so copy it to /home/user/ - cp /home/tooling/.viminfo /home/user/.viminfo && \ - # Bash-related files are backed up to /home/tooling/ incase they are deleted when persistUserHome is enabled. - cp /home/user/.bashrc /home/tooling/.bashrc && \ - cp /home/user/.bash_profile /home/tooling/.bash_profile && \ - chown 10001 /home/tooling/.bashrc /home/tooling/.bash_profile - -USER 10001 -ENV HOME=/home/user -WORKDIR /projects -ENTRYPOINT [ "/entrypoint.sh" ] -CMD ["tail", "-f", "/dev/null"] diff --git a/base/ubi8/entrypoint.sh b/base/ubi8/entrypoint.sh deleted file mode 100644 index 0cdf9eb0..00000000 --- a/base/ubi8/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -source kubedock_setup - -exec "$@" diff --git a/base/ubi8/kubedock_setup.sh b/base/ubi8/kubedock_setup.sh deleted file mode 100755 index 2c8400f8..00000000 --- a/base/ubi8/kubedock_setup.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -# Kubedock setup script meant to be run from the entrypoint script. - -LOCAL_BIN=/home/user/.local/bin -ORIGINAL_PODMAN_PATH=${ORIGINAL_PODMAN_PATH:-"/usr/bin/podman.orig"} -PODMAN_WRAPPER_PATH=${PODMAN_WRAPPER_PATH:-"/usr/bin/podman.wrapper"} - -mkdir -p "${LOCAL_BIN}" - -if [ "${KUBEDOCK_ENABLED:-false}" = "true" ]; then - echo - echo "Kubedock is enabled (env variable KUBEDOCK_ENABLED is set to true)." - - SECONDS=0 - KUBEDOCK_TIMEOUT=${KUBEDOCK_TIMEOUT:-10} - until [ -f $KUBECONFIG ]; do - if ((SECONDS > KUBEDOCK_TIMEOUT)); then - break - fi - echo "Kubeconfig doesn't exist yet. Waiting..." - sleep 1 - done - - if [ -f $KUBECONFIG ]; then - echo "Kubeconfig found." - - KUBEDOCK_PARAMS=${KUBEDOCK_PARAMS:-"--reverse-proxy --kubeconfig $KUBECONFIG"} - - echo "Starting kubedock with params \"${KUBEDOCK_PARAMS}\"..." - - kubedock server ${KUBEDOCK_PARAMS} >/tmp/kubedock.log 2>&1 & - - echo "Done." - - echo "Replacing podman with podman-wrapper..." - - ln -f -s "${PODMAN_WRAPPER_PATH}" "${LOCAL_BIN}/podman" - - export TESTCONTAINERS_RYUK_DISABLED="true" - export TESTCONTAINERS_CHECKS_DISABLE="true" - - echo "Done." - echo - else - echo "Could not find Kubeconfig at $KUBECONFIG" - echo "Giving up..." - fi -else - echo - echo "Kubedock is disabled. It can be enabled with the env variable \"KUBEDOCK_ENABLED=true\"" - echo "set in the workspace Devfile or in a Kubernetes ConfigMap in the developer namespace." - echo - ln -f -s "${ORIGINAL_PODMAN_PATH}" "${LOCAL_BIN}/podman" -fi diff --git a/base/ubi8/podman-wrapper.sh b/base/ubi8/podman-wrapper.sh deleted file mode 100755 index b7f7fbc9..00000000 --- a/base/ubi8/podman-wrapper.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -set -euo pipefail - -PODMAN_ORIGINAL_PATH=${PODMAN_ORIGINAL_PATH:-"/usr/bin/podman.orig"} -KUBEDOCK_SUPPORTED_COMMANDS=${KUBEDOCK_SUPPORTED_COMMANDS:-"run ps exec cp logs inspect kill rm wait stop start"} - -PODMAN_ARGS=( "$@" ) - -TRUE=0 -FALSE=1 - -exec_original_podman() { - exec ${PODMAN_ORIGINAL_PATH} "${PODMAN_ARGS[@]}" -} - -exec_kubedock_podman() { - exec env CONTAINER_HOST=tcp://127.0.0.1:2475 "${PODMAN_ORIGINAL_PATH}" "${PODMAN_ARGS[@]}" -} - -podman_command() { - echo "${PODMAN_ARGS[0]}" -} - -command_is_supported_by_kubedock() { - CMD=$(podman_command) - for SUPPORTED_CMD in $KUBEDOCK_SUPPORTED_COMMANDS; do - if [ "$SUPPORTED_CMD" = "$CMD" ]; then - return $TRUE - fi - done - return ${FALSE} -} - -if command_is_supported_by_kubedock; then - exec_kubedock_podman -else - exec_original_podman -fi diff --git a/universal/ubi8/Dockerfile b/universal/ubi8/Dockerfile deleted file mode 100644 index de25df68..00000000 --- a/universal/ubi8/Dockerfile +++ /dev/null @@ -1,430 +0,0 @@ -# syntax=docker/dockerfile:1.3-labs - -# updateBaseImages.sh can't operate on SHA-based tags as they're not date-based or semver-sequential, and therefore cannot be ordered -FROM quay.io/devfile/base-developer-image:ubi8-latest -LABEL maintainer="Red Hat, Inc." - -LABEL com.redhat.component="devfile-universal-container" -LABEL name="devfile/universal-developer-image" -LABEL version="ubi8" - -#label for EULA -LABEL com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" - -#labels for container catalog -LABEL summary="devfile universal developer image" -LABEL description="Image with developers tools. Languages SDK and runtimes included." -LABEL io.k8s.display-name="devfile-developer-universal" -LABEL io.openshift.expose-services="" - -USER 0 - -# $PROFILE_EXT contains all additions made to the bash environment -ENV PROFILE_EXT=/etc/profile.d/udi_environment.sh -RUN touch ${PROFILE_EXT} & chown 10001 ${PROFILE_EXT} - -USER 10001 - -# We install everything to /home/tooling/ as /home/user/ may get overriden, see github.com/eclipse/che/issues/22412 -ENV HOME=/home/tooling - -# Java -RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ - && bash -c ". /home/tooling/.sdkman/bin/sdkman-init.sh \ - && sed -i "s/sdkman_auto_answer=false/sdkman_auto_answer=true/g" /home/tooling/.sdkman/etc/config \ - && sed -i "s/sdkman_auto_env=false/sdkman_auto_env=true/g" /home/tooling/.sdkman/etc/config \ - && sdk install java 8.0.432-tem \ - && sdk install java 11.0.25-tem \ - && sdk install java 17.0.13-tem \ - && sdk install java 21.0.5-tem \ - && sdk install java 23.1.5.r21-mandrel \ - && sdk default java 17.0.13-tem \ - && sdk install gradle \ - && sdk install maven \ - && sdk install jbang \ - && sdk flush archives \ - && sdk flush temp" \ - && chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling - -# sdk home java -ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.432-tem -ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.25-tem -ENV JAVA_HOME_17=/home/tooling/.sdkman/candidates/java/17.0.13-tem -ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.5-tem - -# Java-related environment variables are described and set by ${PROFILE_EXT}, which will be loaded by ~/.bashrc -# To make Java working for dash and other shells, it needs to initialize them in the Dockerfile. -ENV SDKMAN_CANDIDATES_API="https://api.sdkman.io/2" -ENV SDKMAN_CANDIDATES_DIR="/home/tooling/.sdkman/candidates" -ENV SDKMAN_DIR="/home/tooling/.sdkman" -ENV SDKMAN_PLATFORM="linuxx64" -ENV SDKMAN_VERSION="5.18.2" - -ENV GRADLE_HOME="/home/tooling/.sdkman/candidates/gradle/current" -ENV JAVA_HOME="/home/tooling/.sdkman/candidates/java/current" -ENV MAVEN_HOME="/home/tooling/.sdkman/candidates/maven/current" - -ENV GRAALVM_HOME=/home/tooling/.sdkman/candidates/java/23.1.5.r21-mandrel - -ENV PATH="/home/tooling/.krew/bin:$PATH" -ENV PATH="/home/tooling/.sdkman/candidates/maven/current/bin:$PATH" -ENV PATH="/home/tooling/.sdkman/candidates/java/current/bin:$PATH" -ENV PATH="/home/tooling/.sdkman/candidates/gradle/current/bin:$PATH" -ENV PATH="/home/tooling/.local/share/coursier/bin:$PATH" - -# NodeJS -RUN mkdir -p /home/tooling/.nvm/ -ENV NVM_DIR="/home/tooling/.nvm" -ENV NODEJS_20_VERSION=20.18.1 -ENV NODEJS_18_VERSION=18.20.5 -ENV NODEJS_DEFAULT_VERSION=${NODEJS_18_VERSION} -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | PROFILE=/dev/null bash -RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ${PROFILE_EXT} \ - && echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ${PROFILE_EXT} -RUN source /home/user/.bashrc && \ - nvm install v${NODEJS_20_VERSION} && \ - nvm install v${NODEJS_18_VERSION} && \ - nvm alias default v${NODEJS_DEFAULT_VERSION} && nvm use v${NODEJS_DEFAULT_VERSION} && \ - npm install --global yarn@v1.22.22 &&\ - chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling -ENV PATH=$NVM_DIR/versions/node/v${NODEJS_DEFAULT_VERSION}/bin:$PATH -ENV NODEJS_HOME_20=$NVM_DIR/versions/node/v${NODEJS_20_VERSION} -ENV NODEJS_HOME_18=$NVM_DIR/versions/node/v${NODEJS_18_VERSION} - -# kube -ENV KUBECONFIG=/home/user/.kube/config - -USER 0 - -# Required packages for AWT -RUN dnf install -y libXext libXrender libXtst libXi - -# Lombok -ENV LOMBOK_VERSION=1.18.18 -RUN wget -O /usr/local/lib/lombok.jar https://projectlombok.org/downloads/lombok-${LOMBOK_VERSION}.jar - -# Scala -RUN curl -fLo cs https://git.io/coursier-cli && \ - chmod +x cs && \ - mv cs /usr/local/bin/ -RUN curl -fLo sbt https://raw.githubusercontent.com/dwijnand/sbt-extras/master/sbt && \ - chmod +x sbt && \ - mv sbt /usr/local/bin/ -RUN curl -fLo mill https://raw.githubusercontent.com/lefou/millw/main/millw && \ - chmod +x mill && \ - mv mill /usr/local/bin/ - -# C/CPP -RUN dnf -y install llvm-toolset gcc gcc-c++ clang clang-libs clang-tools-extra gdb - -# Go 1.18+ - installed to /usr/bin/go -# gopls 0.10+ - installed to /home/tooling/go/bin/gopls and /home/tooling/go/pkg/mod/ -RUN dnf install -y go-toolset && \ - GO111MODULE=on go install -v golang.org/x/tools/gopls@latest && \ - chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling -ENV GOBIN="/home/tooling/go/bin/" -ENV PATH="$GOBIN:$PATH" - -# Python -RUN dnf -y install python3.11 python3.11-devel python3.11-setuptools python3.11-pip nss_wrapper - -RUN cd /usr/bin \ - && if [ ! -L python ]; then ln -s python3.11 python; fi \ - && if [ ! -L pydoc ]; then ln -s pydoc3.11 pydoc; fi \ - && if [ ! -L python-config ]; then ln -s python3.11-config python-config; fi \ - && if [ ! -L pip ]; then ln -s pip-3.11 pip; fi - -RUN pip install pylint yq - -# PHP -ENV PHP_VERSION=7.4 -RUN dnf -y module enable php:$PHP_VERSION && \ - dnf install -y --setopt=tsflags=nodocs php php-mysqlnd php-pgsql php-bcmath \ - php-gd php-intl php-json php-ldap php-mbstring php-pdo \ - php-pear php-zlib php-mysqli php-curl php-xml php-devel\ - php-process php-soap php-opcache php-fpm ca-certificates \ - php-gmp php-pecl-xdebug php-pecl-zip mod_ssl hostname && \ - wget https://getcomposer.org/installer -O /tmp/composer-installer.php && \ - php /tmp/composer-installer.php --filename=composer --install-dir=/usr/local/bin - -ENV PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ - PHP_SYSCONF_PATH=/etc \ - PHP_HTTPD_CONF_FILE=php.conf \ - HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ - HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ - HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ - HTTPD_VAR_RUN=/var/run/httpd \ - HTTPD_DATA_PATH=/var/www \ - HTTPD_DATA_ORIG_PATH=/var/www \ - HTTPD_VAR_PATH=/var - -# .NET -ENV DOTNET_RPM_VERSION=8.0 -RUN dnf install -y dotnet-hostfxr-${DOTNET_RPM_VERSION} dotnet-runtime-${DOTNET_RPM_VERSION} dotnet-sdk-${DOTNET_RPM_VERSION} - -# rust -ENV CARGO_HOME=/home/tooling/.cargo \ - RUSTUP_HOME=/home/tooling/.rustup \ - PATH=/home/tooling/.cargo/bin:${PATH} -RUN curl --proto '=https' --tlsv1.2 -sSfo rustup https://sh.rustup.rs && \ - chmod +x rustup && \ - mv rustup /usr/bin/ && \ - rustup -y --no-modify-path --profile minimal -c rust-src -c rust-analysis -c rls && \ - chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling - -# camel-k -ENV KAMEL_VERSION 2.2.0 -RUN curl -L https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/kamel - -# Config directories -RUN mkdir -p /home/tooling/.m2 && \ - mkdir -p /home/tooling/.gradle && \ - mkdir -p /home/tooling/.config/pip && \ - mkdir -p /home/tooling/.sbt/1.0 && \ - mkdir -p /home/tooling/.cargo && \ - mkdir -p /home/tooling/certs && \ - mkdir -p /home/tooling/.composer && \ - mkdir -p /home/tooling/.nuget && \ - chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling - -# Cloud - -# oc client -ENV OC_VERSION=4.15 -RUN curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/oc - -# OS Pipelines CLI (tkn) -ENV TKN_VERSION=1.14.0 -RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/pipelines/${TKN_VERSION}/tkn-linux-amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/tkn /usr/local/bin/opc /usr/local/bin/tkn-pac - -RUN echo 'alias docker=podman' >> ${PROFILE_EXT} - -# Configure container engine -COPY --chown=0:0 containers.conf /etc/containers/containers.conf - -ENV K8S_VERSION=1.28 -## kubectl -RUN < /etc/yum.repos.d/kubernetes.repo -[kubernetes] -name=Kubernetes -baseurl=https://pkgs.k8s.io/core:/stable:/v${K8S_VERSION}/rpm/ -enabled=1 -gpgcheck=1 -gpgkey=https://pkgs.k8s.io/core:/stable:/v${K8S_VERSION}/rpm/repodata/repomd.xml.key -EOF2 - -dnf install -y kubectl -curl -sSL -o ~/.kubectl_aliases https://raw.githubusercontent.com/ahmetb/kubectl-alias/master/.kubectl_aliases -echo '[ -f ~/.kubectl_aliases ] && source ~/.kubectl_aliases' >> ${PROFILE_EXT} -EOF - -## shellcheck -RUN < "${KREW_TGZ}.sha256" - -sha256sum -c "${KREW_TGZ}.sha256" 2>&1 | grep OK - -tar -zxv --no-same-owner -f "${KREW_TGZ}" -./"krew-${KREW_ARCH}" install krew -echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ${PROFILE_EXT} -export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" -# kubens and kubectx -kubectl krew install ns -kubectl krew install ctx -cd - -rm -rf "${TEMP_DIR}" -EOF - -## helm -RUN <&1 | grep OK -tar -zxv --no-same-owner -f "${HELM_TGZ}" -mv "${HELM_ARCH}"/helm /usr/local/bin/helm -cd - -rm -rf "${TEMP_DIR}" -EOF - -## kustomize -RUN <&1 | grep OK -tar -zxv --no-same-owner -f "${KUSTOMIZE_TGZ}" -mv kustomize /usr/local/bin/ -cd - -rm -rf "${TEMP_DIR}" -EOF - -## tektoncd-cli -RUN <&1 | grep OK -tar -zxv --no-same-owner -f "${TKN_TGZ}" -mv tkn /usr/local/bin/ -cd - -rm -rf "${TEMP_DIR}" -EOF - -## knative-cli -RUN <&1 | grep OK -mv "${KN_BIN}" kn -chmod +x kn -mv kn /usr/local/bin -cd - -rm -rf "${TEMP_DIR}" -EOF - -## terraform-cli -RUN <&1 | grep OK -unzip ${TF_ZIP} -chmod +x terraform -mv terraform /usr/local/bin -cd - -rm -rf "${TEMP_DIR}" -EOF - -## skaffold -RUN curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \ - install skaffold /usr/local/bin/ - -# e2fsprogs setup -# Since e2fsprogs-static package has removed RHEL 8 distribution, it is not possible to install from the repository -# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages -RUN <&1 | grep OK -tar -zxv --no-same-owner -f "${E2FSPROGS_TGZ}" -cd "e2fsprogs-${E2FSPROGS_VERSION}" -mkdir build -cd build -../configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs --disable-evms -make -make install -make install-libs -cd - -rm -rf "${TEMP_DIR}" -EOF - -# Bash completions -RUN dnf -y install bash-completion \ - && dnf clean all \ - && rm -rf /var/cache/yum - -RUN < /usr/share/bash-completion/completions/oc -tkn completion bash > /usr/share/bash-completion/completions/tkn -kubectl completion bash > /usr/share/bash-completion/completions/kubectl -cat ${NVM_DIR}/bash_completion > /usr/share/bash-completion/completions/nvm -EOF - -## Add sdkman's init script launcher to the end of ${PROFILE_EXT} since we are not adding it on sdkman install -## NOTE: all modifications to ${PROFILE_EXT} must happen BEFORE this step in order for sdkman to function correctly -RUN echo 'export SDKMAN_DIR="/home/tooling/.sdkman"' >> ${PROFILE_EXT} -RUN echo '[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"' >> ${PROFILE_EXT} - - -# Create symbolic links from /home/tooling/ -> /home/user/ -RUN stow . -t /home/user/ -d /home/tooling/ --no-folding - -# Set permissions on /etc/passwd, /etc/group, /etc/pki and /home to allow arbitrary users to write -RUN chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home /etc/pki - -# cleanup dnf cache -RUN dnf -y clean all --enablerepo='*' - -COPY --chown=0:0 entrypoint.sh / - -USER 10001 - -ENV HOME=/home/user diff --git a/universal/ubi8/containers.conf b/universal/ubi8/containers.conf deleted file mode 100644 index f6ad1381..00000000 --- a/universal/ubi8/containers.conf +++ /dev/null @@ -1,4 +0,0 @@ -[containers] -default_ulimits = [ - "nofile=65535:65535", -] diff --git a/universal/ubi8/entrypoint.sh b/universal/ubi8/entrypoint.sh deleted file mode 100755 index aeb28436..00000000 --- a/universal/ubi8/entrypoint.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -source kubedock_setup - -# Stow -## Required for https://github.com/eclipse/che/issues/22412 - -# /home/user/ will be mounted to by a PVC if persistUserHome is enabled -mountpoint -q /home/user/; HOME_USER_MOUNTED=$? - -# This file will be created after stowing, to guard from executing stow everytime the container is started -STOW_COMPLETE=/home/user/.stow_completed - -if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then - # Create symbolic links from /home/tooling/ -> /home/user/ - stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1 - # Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it - cp /home/tooling/.viminfo /home/user/.viminfo - # We have to restore bash-related files back onto /home/user/ (since they will have been overwritten by the PVC) - # but we don't want them to be symbolic links (so that they persist on the PVC) - cp /home/tooling/.bashrc /home/user/.bashrc - cp /home/tooling/.bash_profile /home/user/.bash_profile - touch $STOW_COMPLETE -fi - -exec "$@"