Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move dockerfiles to build/dockerfiles #573

Merged
merged 11 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: mvn -B clean install -U -Pintegration
- name: Build docker images
if: github.event_name == 'pull_request'
run: ./dockerfiles/build.sh --tag:${{ env.PR_IMAGE_TAG }}
run: ./build/build.sh --tag:${{ env.PR_IMAGE_TAG }}
- name: Push docker images
if: github.event_name == 'pull_request'
run: docker push quay.io/eclipse/che-server:${{ env.PR_IMAGE_TAG }}
11 changes: 1 addition & 10 deletions .github/workflows/next-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,9 @@ jobs:
id: build
run: |
echo "short_sha1=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
./dockerfiles/build.sh --tag:next --sha-tag
./build/build.sh --tag:next --sha-tag
- name: Push docker images
run: |
docker push quay.io/eclipse/che-endpoint-watcher:next
docker push quay.io/eclipse/che-endpoint-watcher:${{ steps.build.outputs.short_sha1 }}

docker push quay.io/eclipse/che-keycloak:next
docker push quay.io/eclipse/che-keycloak:${{ steps.build.outputs.short_sha1 }}

docker push quay.io/eclipse/che-postgres:next
docker push quay.io/eclipse/che-postgres:${{ steps.build.outputs.short_sha1 }}

docker push quay.io/eclipse/che-server:next
docker push quay.io/eclipse/che-server:${{ steps.build.outputs.short_sha1 }}
- name: Create failure MM message
Expand Down
File renamed without changes.
29 changes: 27 additions & 2 deletions dockerfiles/build.include → build/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Copyright (c) 2017 Red Hat, Inc.
#
# Copyright (c) 2017-2023 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/
Expand Down Expand Up @@ -151,7 +152,7 @@ build_image() {
else
printf "${RED}Failure when tagging docker image ${SHA_IMAGE_NAME}${NC}\n"
exit 1
fi
fi
fi
if [ ! -z "${IMAGE_ALIASES}" ]; then
for TMP_IMAGE_NAME in ${IMAGE_ALIASES}
Expand Down Expand Up @@ -227,3 +228,27 @@ get_mount_path() {
CLEAN_PATH=$(get_clean_path "${POSIX_PATH}")
echo $CLEAN_PATH
}

# grab assembly
DIR="$(cd "$(dirname "$0")"; pwd)/dockerfiles"
if [ ! -d "${DIR}/../../assembly/assembly-main/target" ]; then
echo "${ERROR}Have you built assembly/assemby-main in ${DIR}/../assembly/assembly-main 'mvn clean install'?"
exit 2
fi

# Use of folder
BUILD_ASSEMBLY_DIR=$(echo "${DIR}"/../../assembly/assembly-main/target/eclipse-che-*/eclipse-che-*/)
LOCAL_ASSEMBLY_DIR="${DIR}"/eclipse-che

if [ -d "${LOCAL_ASSEMBLY_DIR}" ]; then
rm -r "${LOCAL_ASSEMBLY_DIR}"
fi

echo "Copying assembly ${BUILD_ASSEMBLY_DIR} --> ${LOCAL_ASSEMBLY_DIR}"
cp -r "${BUILD_ASSEMBLY_DIR}" "${LOCAL_ASSEMBLY_DIR}"

init --name:server "$@"
build

#cleanUp
rm -rf ${DIR}/eclipse-che
File renamed without changes.
40 changes: 40 additions & 0 deletions build/dockerfiles/brew.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2018-2023 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-minimal
FROM ubi8-minimal:8.7-1085
USER root
ENV CHE_HOME=/home/user/devspaces
ENV JAVA_HOME=/usr/lib/jvm/jre
RUN microdnf install java-11-openjdk-headless tar gzip shadow-utils findutils && \
microdnf update -y && \
microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \
adduser -G root user && mkdir -p /home/user/devspaces
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

# see fetch-artifacts-pnc.yaml
COPY artifacts/assembly-main.tar.gz /tmp/assembly-main.tar.gz
RUN tar xzf /tmp/assembly-main.tar.gz --strip-components=1 -C /home/user/devspaces; rm -f /tmp/assembly-main.tar.gz

# this should fail if the startup script is not found in correct path /home/user/devspaces/tomcat/bin/catalina.sh
RUN mkdir /logs /data && \
chmod 0777 /logs /data && \
chgrp -R 0 /home/user /logs /data && \
chown -R user /home/user && \
chmod -R g+rwX /home/user && \
find /home/user -type d -exec chmod 777 {} \; && \
java -version && echo -n "Server startup script in: " && \
find /home/user/devspaces -name catalina.sh | grep -z /home/user/devspaces/tomcat/bin/catalina.sh

USER user

# append Brew metadata here
File renamed without changes.
77 changes: 0 additions & 77 deletions dockerfiles/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions dockerfiles/che/.cccp.yml

This file was deleted.

37 changes: 0 additions & 37 deletions dockerfiles/che/build.sh

This file was deleted.

16 changes: 0 additions & 16 deletions dockerfiles/endpoint-watcher/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions dockerfiles/endpoint-watcher/build.sh

This file was deleted.

26 changes: 0 additions & 26 deletions dockerfiles/endpoint-watcher/entrypoint.sh

This file was deleted.

23 changes: 0 additions & 23 deletions dockerfiles/keycloak/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions dockerfiles/keycloak/build.sh

This file was deleted.

Loading